Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0020/stat02.sta
There are 2 other files named stat02.sta in the archive. Click here to see a list.
100'  NAME--STAT02
110'
120'  DESCRIPTION--COMPUTES THE MEANS, VARIANCES, AND T-RATIO
130'  FOR TWO GROUPS OF DATA,UNPAIRED. THIS PROGRAM ASSUMES THAT THE
140'  TWO GROUPS HAVE THE SAME VARIANCE.
150'
160'  SOURCE--UNKNOWN
170'
180'  INSTRUCTIONS--PUT DATA IN LINES 900 THROUGH 919.
190'  END THE FIRST SERIES OF DATA WITH 999999 AND THEN TYPE
200'  THE SECOND SERIES, AGAIN ENDING WITH 999999.
210'  SAMPLE DATA ARE IN LINES 900 AND 910.
220'
230'
240'
250'  *  *  *  *  *  *   MAIN PROGRAM  *  *  *  *  *  *  *  *  *  *  *
260'
270  LET P = 1
280  LET S = 0
290  LET S2 = 0
300  LET N = 0
310  READ X
320  IF X = 999999 THEN 370
330  LET S = S + X
340  LET S2 = S2 + X*X
350  LET N = N + 1
360  GO TO 310
370  LET S(P) = S
380  LET Z(P) = S2
390  LET N(P) = N
400  IF P = 2 THEN 430
410  LET P = 2
420  GO TO 280
430  REM  NOW WE PRINT THE ANSWERS
440  PRINT "GROUP", "NUMBER", "MEAN", "VARIANCE", "STD. DEV."
450  PRINT
460  FOR I = 1 TO 2
470  LET M(I) = S(I)/N(I)
480  LET V(I) = (N(I)*Z(I) - S(I)*S(I))/N(I)/(N(I) - 1)
490  LET D(I) = SQR(V(I))
500  PRINT I, N(I), M(I), V(I), D(I)
510  NEXT I
520  LET Q = V(1)*(N(1)-1)+V(2)*(N(2)-1)
530  LET Q = Q/( N(1) + N(2) -2 ) * ( 1/N(1) + 1/N(2) )
540  LET R = M(1) -M(2)
550  LET W = SQR(Q)
560  PRINT 
570  PRINT "MEAN DIFF.", "VAR. DIFF.", "STD. DEV. DIFF."
580  PRINT R,Q,W
590  PRINT
600  PRINT "T RATIO", R/W, "ON"; N(1)+N(2)-2; "DEGREES OF FREEDOM."
610  STOP
900 DATA  160,160,140,190,999999
910 DATA  117,145,147,120,150,120,999999
920 END