home *** CD-ROM | disk | FTP | other *** search
-
- 10 @ : @"Version 02/27/81" : @
- 11 @"********"
- 30 Input"Enter a Chi-squared value. ",X2
- 40 Input"Enter the number of degrees of freedom. ",Freedom
- 41 If Freedom>60 Then @"Too many degrees of freedom." : Goto 40
- 50 Call .X2'value (X2,Freedom)
- 60 Goto 11
- 70 Procedure .X2'value (X2,Freedom)
- 80 Local I,Z,M,Trail,Numerator,Denominator
- 90 Denominator=1
- 100 For I=Freedom To 2 Step-2
- 110 Denominator=Denominator*I
- 120 Next I
- 130 Numerator=X2**(Int((Freedom+1)/2))*Exp(-X2/2)
- 140 If Fra(Freedom/2)=0 Then Do
- 150 Factor=1
- 160 Else
- 170 Factor=Sqr(2/(X2*3.141592653599))
- 180 Enddo
- 190 Z=1
- 200 M=1
- 210 Repeat
- 220 Freedom=Freedom+2
- 230 M=M*X2/Freedom
- 240 Z=Z+M
- 250 Until M<1E-20
- 260 Tail=1-Factor*Z*(Numerator/Denominator)
- 270 @ : @"Significance >";
- 280 @ Using"##.#####",Tail
- 310 @
- 320 Endproc
-