 Web pdp-10.trailing-edge.com

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/stat17.sta
There are 2 other files named stat17.sta in the archive. Click here to see a list.
```100'  NAME--STAT17
110'
120'  DESCRIPTION--PRODUCES THE ANOVA TABLE OF A BALANCED INCOMPLETE
130'  BLOCK DESIGN AND F-RATIO FOR TREATMENTS.  THE SUM-OF-SQUARES
140'  IS ADJUSTED BECAUSE OF INCOMPLETENESS.
150'
160'  SOURCE--UNKNOWN
170'
180'  INSTRUCTIONS--ENTER DATA IN LINE 900 AND FOLLOWING.
190'  FIRST DATA IS B, THE NUMBER OF BLOCKS, THEN T, THE NUMBER OF
200'  TREATMENTS, THEN K, THE NUMBER OF TREATNEMTS PER BLOCK,
210'  AND FINALLY R,THE NUMBER OF REPLICATIONS FOR EACH TREATMENT.
220'  NEXT ENTER N(I,J) MATRIX BY ROWS, N(I,J)=1 IF
230'  TREATMENT J APPEARS IN BLOCK I AND 0 OTHERWISE. FINALLY ENTER
240'  THE MATRIX OF OBSERVATIONS,X(I,J). IF N(I,J)=0 LET X(I,J)=0.
250'  IF B OR  T ARE GREATER THAN 10 DIM STATEMENTS MUST
270'  SAMPLE DATA ARE IN LINES 900 THROUGH 980.
280'
290'
300'  *  *  *  *  *  *  *  MAIN PROGRAM   *  *  *  *  *  *  *  *  *
310'
320 READ B, T, K, R
330 IF B*K<>T*R THEN 990
340 LET L = R*(K-1)/(T-1)
350 LET L1 = INT(L)
360 IF L1 - L <> 0 THEN 990
370 FOR I = 1 TO B
380 FOR J = 1 TO T
400 LET Q(J) = 0
410 LET P(J) = 0
420 LET S(J) = 0
430 NEXT J
440 LET G(I) = 0
450 NEXT I
460 LET A3 = 0
470 LET U = 0
480 FOR I = 1 TO B
490 FOR J = 1 TO T
510 LET A3 = A3 + X(I,J)^2
520 LET U = U + X(I,J)
530 LET G(I) = G(I) + X(I,J)
540 NEXT J
550 NEXT I
560 FOR J = 1 TO T
570 FOR I = 1 TO B
580 LET S(J) = S(J) + X(I,J)
590 LET P(J) = P(J) + N(I,J)*G(I)
600 NEXT I
610 NEXT J
620 LET C = (U^2)/B/K
630 LET W = 0
640 FOR J = 1 TO T
650 LET Q(J) = K*S(J) - P(J)
660 LET W = W + Q(J)^2
670 NEXT J
680 LET A = W/K/T/L
690 LET W1 = 0
700 FOR I = 1 TO B
710 LET W1 = W1 + G(I)^2
720 NEXT I
730 LET A1 = (W1/K) - C
740 LET A2 = A3 - A1 - A - C
750 LET D = B*K - (B-1) - (T-1) -1
760 PRINT "ANOVA TABLE:"
770 PRINT
780 PRINT "ITEM", "SS", "DF", "MS"
790 PRINT
800 PRINT "GRAND TOTAL", A3, B*K
810 PRINT "GRAND MEAN", C, " 1"
820 PRINT "TREATMENTS", A, T-1, A/(T-1)
830 PRINT "BLOCKS", A1, B-1"   ...BLOCK MS NOT ADJUSTED..."
840 PRINT "ERROR", A2, D, A2/D
850 PRINT
860 PRINT
870 LET F = A*D/(T-1)/A2
880 PRINT "F-RATIO ="F", ON"T-1"AND"D"DEGREES OF FREEDOM."
890 STOP
900 DATA 4,4,3,3
910 DATA 1,0,1,1
920 DATA 0,1,1,1
930 DATA 1,1,1,0
940 DATA 1,1,0,1
950 DATA 2,0,20,7
960 DATA 0,32,14,3
970 DATA 4,13,31,0
980 DATA 0,23,0,11
990 PRINT "YOUR EXPERIMENT IS NOT BALANCED."
1000 END

```