Statistical Measures

Date: 198x
Type: Program
Platform(s): TS 1000

Appears on

Assembled by Tim Ward from many sources. Contains programs 10051 – 10121.

Gallery

Statistical Measures

Source Code

  20 PRINT "STATISTICAL MEASURES",,,
  30 LET X$="********************************"
  40 LET M=100
  50 LET M4=10
  60 LET L=9999
  70 DIM D(M)
  75 DIM S(M4)
  80 PRINT "ENTER DATA--END WITH  ";L;" OR ENTER"
  90 FOR I=1 TO M
 100 LET D(I)=L
 110 INPUT D(I)
 120 IF D(I)=L THEN GOTO 140
 130 NEXT I
 140 LET I1=I-1
 150 PRINT "SHALL I PRINT DATA ITEMS(Y/N)";
 160 INPUT A$
 170 IF A$="Y" THEN GOSUB 330
 180 GOSUB 540
 190 GOSUB 620
 200 GOSUB 740
 210 GOSUB 830
 220 GOSUB 1050
 230 GOSUB 1140
 240 REM %P%R%O%G%R%A%M% %T%E%R%M%I%N%A%T%I%O%N
 270 PRINT 
 280 PRINT 
 290 PRINT "PROCESSING COMPLETE"
 300 PRINT 
 310 STOP 
 330 REM %P%R%I%N%T% %D%A%T%A
 350 PRINT 
 360 PRINT X$
 370 PRINT " NR.";TAB (5);"DATA"
 380 FOR I=1 TO I1
 390 PRINT I;TAB (5);D(I)
 400 NEXT I
 410 PRINT "WANT TO CORRECT DATA Y/N?";
 420 LET A$=""
 430 INPUT A$
 440 IF A$<>"Y" THEN GOTO 520
 450 PRINT "ENTER ITEM NR TO CHANGE";
 460 LET N=0
 470 INPUT N
 480 IF N=0 THEN GOTO 410
 490 PRINT "ENTER CORRECTED DATA";
 500 INPUT D(N)
 510 GOTO 410
 520 RETURN 
 540 REM %A%R%I%T%H%M%E%T%I%C% %M%E%A%N% %=% %S%1
 560 FOR I=1 TO I1
 570 LET S1=S1+D(I)
 580 NEXT I
 590 LET S1=S1/I1
 600 RETURN 
 620 REM %S%O%R%T% %D%A%T%A
 640 FOR I=1 TO I1-1
 650 FOR J=I+1 TO I1
 660 IF D(I)<=D(J) THEN GOTO 700
 670 LET DO=D(I)
 680 LET D(I)=D(J)
 690 LET D(J)=DO
 700 NEXT J
 710 NEXT I
 720 RETURN 
 740 REM %M%E%D%I%A%N% %=% %S%2
 760 LET T6=INT (I1/2)
 770 IF T6<>I1/2 THEN GOTO 800
 780 LET S2=(D(T6)+D(T6+1))/2
 790 GOTO 810
 800 LET S2=D(T6+1)
 810 RETURN 
 830 REM %M%O%D%E% %=% %S%3
 850 LET T5=L
 860 LET K=1
 870 DIM C(I1)
 880 LET D(I1+1)=L
 890 FOR I=1 TO I1+1
 900 IF D(I)=T5 THEN GOTO 960
 910 LET T5=D(I)
 920 LET C(I-1)=CO
 930 IF CO>C9 THEN LET C9=CO
 940 LET C0=1
 950 GOTO 970
 960 LET CO=CO+1
 970 NEXT I
 980 FOR I=1 TO I1
 990 IF C(I)<>C9 THEN GOTO 1020
1000 LET S3=D(I)
1010 LET K=K+1
1020 NEXT I
1030 RETURN 
1050 REM %S%T%D% %D%E%V%I%A%T%I%O%N%(%S%4%)%/%V%A%R%I%A%N%C%E% %(%S%5%)
1070 FOR I=1 TO I1
1080 LET T8=T8+(D(I)-S1)*(D(I)-S1)
1090 NEXT I
1100 LET S5=T8/I1
1110 LET S4=SQR (S5)
1120 RETURN 
1140 REM %P%R%I%N%T% %R%E%S%U%L%T%S
1160 PRINT X$
1170 PRINT 
1180 PRINT 
1190 PRINT "NUMBER = ";I1
1200 PRINT "SUM = ";S1
1210 PRINT 
1220 PRINT "MEAN = ";S1
1230 PRINT "MEDIAN = ";S2
1240 PRINT "MODE = ";
1250 FOR I=1 TO K-1
1260 PRINT S3,(I);
1270 NEXT I
1280 PRINT 
1290 PRINT "MINIMUM = ";D(1)
1300 PRINT "MAXIMUM = ";D(I1)
1310 PRINT "RANGE = ";D(I1)-D(1)
1320 PRINT "STANDARD DEVIATION = ";S4
1330 PRINT "VARIANCE = ";S5
1340 PRINT 
1350 PRINT X$
1360 RETURN 
1370 CLEAR 
1380 SAVE "1007%2"
1390 RUN 

People

No people associated with this content.

Scroll to Top