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