Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/stat13.sta
There are 2 other files named stat13.sta in the archive. Click here to see a list.
100'  NAME--STAT13
110'
120'  DESCRIPTION--COMPUTES THE ANALYSIS OF VARIANCE FOR A 
130'  ONE-WAY COMPLETELY RANDOMIZED DESIGN.
140'
150'  SOURCE--UNKNOWN
160'
170'  INSTRUCTIONS--ENTER DATA IN LINES 1010 AND FOLLOWING.
180'  ENTER DATA IN THE FOLLOWING ORDER:
190'  
200'  1)A, THE TOTAL NUMBER OF OBSERVATIONS
210'  2)M, THE NUMBER OF DIFFERENT TREATMENTS
220'  3)N(1)........N(M),  WHERE N(J) IS THE NUMBER OF OBSERVATIONS
230'    IN TREATMENT J
240'  4)THE OBSERVATIONS THEMSELVES, FIRST FOR TREATMENT 1, THEN 
250'    TREATMENT 2,  ETC.
260'  
270'  IF ANY N(J)>20 CHANGE THE DIMS IN LINE 340.
280'  IF M>10 CHANGE THE DIMS IN LINE 340.
290'  SAMPLE DATA IS IN LINES 1010 THROUGH 1040.
300'
310'
320'  *  *  *  *  *  *  *   MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *
330'
340 DIM X(20,10),N(10),T(10),S(10)
350 READ A, M
360    MAT READ N(M)
370 FOR J = 1 TO M
380 FOR I = 1 TO N(J)
390 READ X(I,J)
400 NEXT I
410 NEXT J
420 FOR J = 1 TO M
430 FOR I = 1 TO N(J)
440 LET T(J) = T(J) + X(I,J)
450 LET S(J) = S(J) + X(I,J)*X(I,J)
460 NEXT I
470 LET U=U+T(J)
480 LET R=R+S(J)
490 LET V=V+T(J)*T(J)/N(J)
500 NEXT J
510 LET C = U*U/A
520 LET W = V - C
530 LET E = R - V
540 PRINT "ANOVA TABLE:"
550 PRINT
560 PRINT "ITEM","SS","DF","MS"
570 PRINT
580 PRINT "GRAND TOTAL",R,A
590 PRINT "GRAND MEAN",C," 1"
600 PRINT "TREATMENTS", W, M-1, W/(M-1)
610 PRINT "ERROR",E,A-M,E/(A-M)
620 PRINT
630 PRINT
640 LET F = (W/(M-1))/(E/(A-M))
650 PRINT "F ="F"ON"M-1"AND"A-M"DEGREES OF FREEDOM."
660 LET G=F
670 LET N=A-M
680 LET M=M-1
690 GOSUB 710
700 STOP
710 REM THE SUBROUTINE FOR COMPUTATION OF THE F PROBABILITIES WAS
720 REM PROGRAMMED BY VICTOR E. MCGEE, PSYCHOLOGY DEPARTMENT, 646-2771
730 LET P=1
740 IF G<1 THEN 790
750 LET A=M
760 LET B=N
770 LET F=G
780 GO TO 820
790 LET A=N
800 LET B=M
810 LET F=1/G
820 LET A1=2/(9*A)
830 LET B1=2/(9*B)
840 LET Z=ABS((1-B1)*F^(.333333)-1+A1)
850 LET Z=Z/SQR(B1*F^(.666667)+A1)
860 IF B<4 THEN 900
870 LET P=(1+Z*(.196854+Z*(.115194+Z*(.000344+Z*.019527))))^4
880 LET P=.5/P
890 GO TO 920
900 LET Z=Z*(1+.08*Z^4/B^3)
910 GO TO 870
920 IF G<1 THEN 940
930 GO TO 960
940 LET P=1-P
950 GO TO 960
960 PRINT
970 LET P = INT(100000*P)/100000
980 PRINT "EXACT PROB. OF F=";G;"WITH ( "M;", "N;" ) D.F. IS ";P
990 PRINT
1000 RETURN
1010 DATA 25, 5
1020 DATA 2, 6, 11, 4, 2
1030 DATA 83,85,84,85,85,86,86,87,86,87,87,87,88,88,88,88,88
1040 DATA 89,90,89,90,90,91,90,92
1050END