10 '******************* 20 ' The Statistician 30 ' by Dirk Tjossem 40 'copyright1982 Artsci 50 '******************* 60 WIDTH 40,8,1 70 CLS 80 PRINT "Mean, Variance," 90 PRINT "Std Deviation"; 100 LPRINT"THE STATISTICIAN" 110 FOR I=1 TO 1000 :NEXT: CLS 120 CLS 130 PRINT "Methods:" 140 PRINT "(1=freq distribution)" 150 PRINT "(2=sample) 160 PRINT "Which method? "; 170 S$=INKEY$: IF S$="" GOTO 170 180 IF NOT (VAL(S$)=1 OR VAL(S$)=2) GOTO 120 190 PRINT S$;: S= VAL(S$)-1: S$="" 200 CLS 210 PRINT "Data Types:" 220 PRINT "(1=grouped)" 230 PRINT "(2=ungrouped) 240 PRINT "Which type? "; 250 S$=INKEY$: IF S$="" GOTO 250 260 IF NOT (VAL(S$)=1 OR VAL(S$)=2) GOTO 200 270 PRINT S$;: K= VAL(S$)-1: S$="" 280 CLS 290 INPUT "# Observations? ",N 300 R=0: M=R: P=R 310 CLS 320 IF K=1 GOTO 500 330 LPRINT "Frequency List" 340 PRINT "Enter Item, Freq " 350 LPRINT " No. Item Freq" 360 FOR I=1 TO N 370 PRINT " ";I;":"; 380 INPUT "item? ",A 390 INPUT " freq? ",B 400 LPRINT USING "####";I; 410 LPRINT "#"; 420 LPRINT USING "#######";A;B 430 R=R+B*A 440 P=P+B 450 M=M+B*A^2 460 NEXT I 470 R=R/P 480 V=(M-P*R^2)/(P-S) 490 GOTO 600 500 LPRINT "Item List" 510 FOR I=1 TO N 520 PRINT "Item";I;"?"; 530 INPUT "",D 540 LPRINT USING "#####";D 550 P=P+D 560 M=M+D^2 570 NEXT I 580 R=P/N 590 V=(M-N*R^2)/(N-S) 600 CLS 610 PRINT "Mean= ";R 620 LPRINT "Mean= ";R 630 PRINT "Var= ";V 640 LPRINT "Var= ";V 650 PRINT "S.D.= ";SQR(V) 660 LPRINT "S.D.=";SQR(V) 670 LPRINT 680 PRINT ""; 690 S$=INKEY$: IF S$="" GOTO 690 700 PRINT 710 CLS 720 PRINT "MORE DATA? "; 730 S$=INKEY$: IF S$="" GOTO 730 740 IF S$="Y" OR S$="y" THEN CLS: GOTO 130 750 END