Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap1_198111 - decus/20-0020/stat16.sta
There are 2 other files named stat16.sta in the archive. Click here to see a list.
100'  NAME--STAT16
110'
120'  DESCRIPTION--COMPUTES THE ANALYSIS OF VARIANCE TABLE FOR
130'  A SIMPLE GRAECO-LATIN SQUARE DESIGN.
140'
150'  SOURCE--UNKNOWN
160'
170'  INSTRUCTIONS--PLACE DATA IN LINE 1100 AND FOLLOWING.
180'  FIRST DATA IS N, THE NUMBER OF TREATMENTS.  THEN 
190'  THE MATRIX GIVING THE LATIN TREATMENT ASSIGNMENTS
200'  (NUMBERED FROM 1 TO N ONLY) IS ENTERED. FOLLOWING
210'  THAT THE MATRIX GIVING THE GRAECO TREATMENTS IS ENTERED.
220'  FINALLY THE MATRIX OF DATA IS ENTERED. ALL MATRICES SHOULD
230'  BE ENTERED BY ROWS. IF N IS GREATER THAN 10 A DIM
240'  STATEMENT SHOULD BE ADDED TO THE PROGRAM.
250'  SAMPLE DATA ARE IN LINES 1100 THROUGH 1160.
260'
270'
280'  *  *  *  *  *  *    MAIN PROGRAM  *  *  *  *  *  *  *  *  *
290'
300  READ N
310    MAT READ M(N,N)
320    MAT READ N(N,N)
330  FOR I = 1 TO N
340     FOR J = 1 TO N
350        READ X
360        LET R(I) = R(I) + X
370        LET C(J) = C(J) + X
380        LET T(M(I,J)) = T(M(I,J)) + X
390        LET G(N(I,J)) = G(N(I,J)) + X
400        LET S = S + X
410        LET S0 = S0 + X*X
420     NEXT J
430 NEXT I
440 FOR I = 1 TO N
450     LET S4 = S4 + R(I)^2
460     LET S5 = S5 + C(I)^2
470     LET S6 = S6 + T(I)^2
480     LET S3 = S3 + G(I)^2
490  NEXT I
500  LET C = S*S/N/N
510  LET S4 = S4/N - C
520  LET S5 = S5 / N - C
530  LET S6 = S6 /N - C
540  LET S3 = S3/N - C
550  LET D1 = N - 1
560  LET D2 = D1 *(N - 3)
570  LET S7 = S0 - C - S4 - S5 - S6
580  LET S7 = S7 - S3
590  PRINT "ITEM  ", "SUM-SQR  ", "DEG. FREE.  ", "MEAN-SQR  ", "F-RATIO"
600  PRINT "----  ", "-------  ", "----------  ", "-------- ", "-------"
610  LET S8 = S7/D2
620  PRINT "ROWS  ", S4, D1, S4/D1, S4/D1/S8
630  PRINT "COLS  ", S5, D1, S5/D1, S5/D1/S8
640  PRINT "TREAT L  ", S6, D1, S6/D1, S6/D1/S8
650  PRINT "TREAT G  ", S3, D1, S3/D1, S3/D1/S8
660  PRINT "ERROR ", S7, D2, S8
670 PRINT
680 PRINT
690 LET M=D1
700 LET N=D2
710 LET G=S4/D1/S8
720 GOSUB 800
730 LET G=S5/D1/S8
740 GOSUB 800
750 LET G=S6/D1/S8
760 GOSUB 800
770 LET G=S3/D1/S8
780 GOSUB 800
790 STOP
800 REM THE SUBROUTINE FOR COMPUTATION OF THE F PROBABILITIES WAS
810 REM PROGRAMMED BY VICTOR E. MCGEE, PSYCHOLOGY DEPARTMENT, 646-2771
820 LET P=1
830 IF G<1 THEN 880
840 LET A=M
850 LET B=N
860 LET F=G
870 GO TO 910
880 LET A=N
890 LET B=M
900 LET F=1/G
910 LET A1=2/(9*A)
920 LET B1=2/(9*B)
930 LET Z=ABS((1-B1)*F^(.333333)-1+A1)
940 LET Z=Z/SQR(B1*F^(.666667)+A1)
950 IF B<4 THEN 990
960 LET P=(1+Z*(.196854+Z*(.115194+Z*(.000344+Z*.019527))))^4
970 LET P=.5/P
980 GO TO 1020
990 LET Z=Z*(1+.08*Z^4/B^3)
1000 GO TO 960
1010 IF G<1 THEN 1030
1020 GO TO 1050
1030 LET P=1-P
1040 GO TO 1050
1050 PRINT
1060 LET P = INT(100000*P)/100000
1070 PRINT "EXACT PROB. OF F=";G;"WITH ( "M;", "N;" ) D.F. IS ";P
1080 PRINT
1090 RETURN
1100  DATA  4
1110  DATA 1,2,3,4,2,1,4,3,3,4,1,2,4,3,2,1
1120  DATA 4,3,2,1,2,1,4,3,1,2,3,4,3,4,1,2
1130  DATA  24, 47, 35, 42
1140  DATA  47, 85, 23, 47
1150  DATA  65, 49, 23, 62
1160  DATA  12, 14, 19, 23
1170END