Google
 

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