10 REM*          STATS1
20 REM*  CALCULATE MEAN, VARIANCE
30 REM*   AND STANDARD DEVIATION
40 REM*
50 REM*  WRITTEN BY RAY GORDON
60 REM*        4-JUN-82
70 REM*
80 PRINT CHR$(26)
90 PRINT:PRINT
100 PRINT "                   STATISTICS ONE
110 PRINT "                     RAY GORDON"
120 PRINT:PRINT
130 PRINT "     For calculating the mean, variance,and"
140 PRINT
150 PRINT "      standard deviation for any number of"
160 PRINT
170 PRINT "                    datapoints."
180 PRINT
190 PRINT "           ENTER DATA, TERMINATE ENTRIES
200 PRINT "                      WITH -0 "
210 PRINT
220 PRINT "         Type <RETURN> after each entry."
230 PRINT:PRINT
240 LET A#=0:LET B#=0
250 INPUT "        ",X
260 IF X=-0 THEN 310
270 LET I=I+1
280 LET A#=A#+X
290 LET B#=B#+X*X
300 GOTO 250
310 LET M#=A#/I
320 LET V#=(B#-((A#*A#)/I))/I
330 LET D#=SQR(V#)
340 PRINT CHR$(26)
350 PRINT:PRINT:PRINT:PRINT
360 PRINT "          NUMBER OF DATAPOINTS = ";I
370 PRINT:PRINT
380 PRINT "        MEAN = ";M#
390 PRINT
400 PRINT "        VARIANCE = ";V#
410 PRINT
420 PRINT "        ST DEV. = ";D#
430 PRINT:PRINT:PRINT
440 END

390 PRINT
400 PRINT "        VARIANCE = ";V#
410 PRINT
420 PRINT "        ST DEV. = ";D#
430 PRINT:PRINT:PRINT
440 E