Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/chisq.sta
There are 2 other files named chisq.sta in the archive. Click here to see a list.
100'  NAME--CHISQ
110'
120'  DESCRIPTION--COMPUTATION OF EXACT PROBABILITY OF A CHI-SQUARE
130'  VALUE WITH THE APPROPRIATE DEGREES OF FREEDOM.
140'
150'  SOURCE--PROGRAMMED BY VICTOR E. MCGEE,DARTMOUTH COLLEGE,
160'  HANOVER, N.H. 03755, AFTER THE FORTRAN PROGRAM GIVEN
170'  IN DONALD J. VELDMAN'S BOOK,"FORTRAN PROGRAMMING FOR THE
180'  BEHAVIORAL SCIENCES(HOLT,RINEHART, AND WINSTON),1967,P.131.
190'
200'  INSTRUCTIONS-- TYPE "RUN" AND FOLLOW THE INSTRUCTIONS AS
210'  THEY APPEAR.
220'
230'  *  *  *  *  *   MAIN PROGRAM   *  *  *  *  *  *  *  *  *  *
240'
250'
260 PRINT "ENTER THE CHI-SQUARE VALUE AND THE D.F."
270 INPUT G1,M
280 LET N=1000
290 LET G=G1/M
300 LET P=1
310 IF G*M*N=0 THEN 540
320 IF G<1 THEN 370
330 LET A=M
340 LET B=N
350 LET F=G
360 GO TO 400
370 LET A=N
380 LET B=M
390 LET F=1/G
400 LET A1=2/(9*A)
410 LET B1=2/(9*B)
420 LET Z=ABS((1-B1)*F^(.333333)-1+A1)
430 LET Z=Z/SQR(B1*F^(.666667)+A1)
440 IF B<4 THEN 480
450 LET P=(1+Z*(.196854+Z*(.115194+Z*(.000344+Z*.019527))))^4
460 LET P=.5/P
470 GO TO 500
480 LET Z=Z*(1+.08*Z^4/B^3)
490 GO TO 450
500 IF G<1 THEN 520
510 GO TO 560
520 LET P=1-P
530 GO TO 560
540 PRINT "YOU HAVE ERRED - INPUT THE TWO VALUES AGAIN"
550 GO TO 270
560 PRINT
570 PRINT
580 PRINT"EXACT PROBABILITY OF CHI-SQUARE="G1;"WITH  "M;"D.F."
590 PRINT
600 PRINT "    IS "INT(100000*P)/100000
610 END