Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0020/stat01.sta
There are 2 other files named stat01.sta in the archive. Click here to see a list.
100' NAME--STAT01
110'
120' DESCRIPTION--COMPUTES THE MEAN, VARIANCE, STANDARD DEVIATION,
130' AND THE STANDARD ERROR OF THE MEAN FOR ONE OR MORE
140' SETS OF DATA.
150'
160' SOURCE--UNKNOWN
170'
180' INSTRUCTIONS--THE DATA START IN LINE NUMBER 900 AND CONTINUE
190' NOT PAST LINE 909. THE NUMBER 999999 MUST BE PLACED AT
200' THE END OF THE LAST DATUM OF EACH SET. SAMPLE DATUM ARE IN LINE
210' 900.
220'
230'
240' * * * * * * * MAIN PROGRAM * * * * * * * * * *
250'
260 READ X
270 IF X = 999999 THEN 320
280 LET S = S + X
290 LET S1 = S1 + X*X
300 LET N = N + 1
310 GO TO 260
320 LET M = S/N
330 LET V = (N*S1 -S*S)/N/(N-1)
340 LET S3 = SQR(V)
350 LET S4 = SQR(V/N)
360 PRINT"NUMBER","SUM SUM-OF-SQUARES","MEAN","VARIANCE"
370 PRINT N, S, S1, M, V
380 PRINT
390 LET Q = S3/M
400 PRINT "STD. DEV.", "STD. ERROR OF THE MEAN","COEFF. OF VARIATION"
410 PRINT S3, S4, " ", Q
420 PRINT
430 PRINT
440 READ X
450 IF X = 999999 THEN 500
460 LET S=0
470 LET S1=0
480 LET N=0
490 GOTO 280
500 STOP
900 DATA 1,2,3,4,5,6,7,8,9,10,999999,4,3,9,15,21,6,999999
910 DATA 999999
920 END