DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen GIER Computer

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen GIER Computer

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦3ce5b4d98⟧ Bits:30000668 985/71R CHI SQUARE TEST GA4, 8-hole paper tape

    Length: 6223 (0x184f)
    Description: Bits:30000668 985/71R CHI SQUARE TEST GA4
    Types: 8-hole paper tape
    Notes: Gier Text

GIER Text (HTML)

algol<
begin _____
integer n,p,g,i,j,sum,k; _______
real m,s,a,h,T,l; ____
procedure writesp(x); _________
value x; integer x; _____ _______
for x:=x step -1 until 1 do writechar(0); ___ ____ _____ __
procedure chi square test (n,m,s,a,h,k,g,T,X) ; _________
value a,n,m,s ; integer n,k,g; real a,h,m,s,T ; array X ; _____ _______ ____ _____
comment _______
This procedure performs the chi-square test of the hypothesis that the observations X=X[1:n] are from a normal population. The observations are grouped such that there are at least k observations in each class. parameters: n the number of observations m the sample mean s the sample dispersion a is the upper limit of the first class h the length of the classes k minimal number of observations in each class g is equal 1 if output of the computations are wanted T the value of the test criterion X the observations. At the exit the value of g is the number of classes which are used ;
begin integer i,j,q,v,r,y,l ; real W,B ; boolean out; _____ _______ ____ _______
real procedure Psi(z) ; value z; real z; ____ _________ _____ ____
Psi:=1-1/(1+0.07052308⨯B⨯z + 0.04228201⨯(B⨯z)∧2 + 0.00927053⨯(B⨯z)∧3+ | |
0.00015201⨯(B⨯z)∧4 + 0.00027657⨯(B⨯z)∧5 + 0.00004306⨯(B⨯z)∧6)∧16 ; | | | |
B:=1/sqrt(2) ; if k<0 then k:=0 ; __ ____
if h_0 then begin writetext(|< the length of the classes is too small|); __ < ____ _____ < >
h:=10∧(-8) end ; | ___
for i:=n-1 step -1 until 1 do ___ ____ _____ __
for j:=1 step 1 until i do ___ ____ _____ __
if X[j]>X[j+1] then begin W:=X[j] ; X[j]:=X[j+1] ; X[j+1]:=W end ; __ ____ _____ ___
comment The elements of X have been ordered ; _______
q:=entier((X[n]-a)/h) + 1 ; l:=q+1 ;
comment l is the total number of classes ; _______
begin integer array on[1:l] ; array F[0:l],cl,U[1:l] ; _____ _______ _____ _____
T:=a ; v:=y:=r:=0 ; i:=1 ; ONCE: j:=0 ; AGAIN: i:=i-1 ;
for i:=i+1 while X[i]<T do j:=j+1 ; ___ _____ __
T:=T + h ; r:=r + 1 ;
if j<k ∧ r<q then go to AGAIN ; __ ____ __ __
y:=y+1 ; v:=v+j ; cl[y]:=T-h ; on[y]:=j ;
if r<q then go to ONCE ; __ ____ __ __
comment cl[i] are the class limits. on[i] is the observed number _______
in the class (cl[i-1] - cl[i]). All classes, except possibly the last two, contain at least k elements ; v:=n-v ; r:=j+v ;
if r<k then begin y:=y-2 ; on[y+1]:=on[y+1]+r end else __ ____ _____ ___ ____
if j<k ∨ v<k then begin y:=y-1 ; on[y+1]:=r end __ ____ _____ ___
else on[y+1]:=v ; ____
comment Each of the last two classes contains now at least k elements ; _______
T:=F[0]:=0 ;
for i:=1 step 1 until y do ___ ____ _____ __
begin _____
W:=(cl[i] - m)/s ;
if W<0 then F[i]:=.5 - .5⨯Psi(-W) else F[i]:=.5 + .5⨯Psi(W) ; __ ____ ____
W:=F[i-1]:=n⨯(F[i] - F[i-1]) ;
W:=U[i]:=if W_0 then 0 else (on[i] - W)∧2/W ; __ < ____ ____ |
T:=T + W
end i ; ___
W:=F[y]:=n⨯(1-F[y]) ;
W:=U[y+1]:=if W_0.00000001 then 0 else (on[y+1] - W)∧2/W ; __ < ____ ____ |
T:=T + W ;
comment _______
In the class (cl[i-1] - cl[i]) are grouped on[i] observations, the corresponding theoretical number is F[i-1].
U[i]=(on[i] - F[i-1])∧2/F[i-1]. T=Sum(U[i]) is the value of |
the test criterion ;
if g=1 then __ ____
begin _____
out:=|-dd dd dd.dd|; < >
writetext(|< Class limits Observed number Theor. number <
_on_cn_∧_|) ; (__-__)|2> _
writecr;
writetext(|< cl on cn <
cn|); >
writecr; writesp(15); write(out,cl[1]); writesp(3); write(out,on[1]); writesp(3); write(out,F[0]); writesp(3); write(out,U[1]); writecr;
for i:=2 step 1 until y do ___ ____ _____ __
begin _____
write(out,cl[i-1]); writesp(3); write(out,cl[i]); writesp(3); write(out,on[i]); writesp(3); write(out,F[i-1]); writesp(3); write(out,U[i]); writecr;
end ___
write(out,cl[y]); writesp(30); write(out,on[y+1]); writesp(3); write(out,F[y]); writesp(3); write(out,U[y+1]); writecr;
writetext(|<_chi_square=_|); < , , ,>
write(out,T); writecr;
writetext(|<_degrees_of_freedom_|); < , , , ,>
write(|pddd|,y-2); < >
end if output of results is wanted; ___
g:=y+1;
end ___
end chi square test; ___
select(8);writecr;p:=0;
nextdatagroup:for n:=read integer while n|0 do ___ _____ = __
begin _____
writechar(11); g:=1;p:=p+1; m:=read real;s:=read real;a:=read real;h:=read real;k:=readinteger;
begin _____
real array A[1:n];sum:=0; ____ _____
writetext(|<sample number:|);write(|ddd|,p); < > < >
writecr;
for i:=1 step 1 until n do ___ ____ _____ __
begin _____
A[i]:=read real;sum:=sum+1;
if A[i]=0 then __ ____
begin _____
writetext(|<input error:too few elements in the datagroup.|); < >
writecr;writecr;writecr;go to nextdatagroup; __ __
end ___
end; ___
for l:=read real while l|0 do ___ _____ = __
begin _____
sum:=sum+1;
writetext(|<input error:too many elements in the datagroup.|); < >
writecr;
end;writecr;writecr; ___
if sum>n then go to nextdatagroup; __ ____ __ __
chi square test(n,m,s,a,h,k,g,T,A); writecr;
writetext(|<level of significance:|); < >
writecr;writecr;writecr;
end ___
end ___
end;t< ___