Web pdp-10.trailing-edge.com

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50144/testud.bas
There are 2 other files named testud.bas in the archive. Click here to see a list.
```12 DATA 5000000,5398278,5792597,6179114,6554217,6914625,7257469
13 DATA 7580363,7881446,8159399,8413447,8643339,8849303,9031995
14 DATA 9192433,9331928,9452007,9554345,9640697,9712834,9772499
15 DATA 9821356,9860966,9892759,9918025,9937903,9953388,9965330
16 DATA 9974449,9981342,9986501,9990324,9993129,9995166,9996631
17 DATA 9997674,9998409,9998922,9999277,9999519,9999683,9999793
18 DATA 9999867,9999915,9999946,9999966,9999979,9999987,9999992
19 DIM X(48)
180 DEF FND(V)=X(V)-X(V-1)
190 DEF FNT(V)=1-((V^2)+1)/(4*D)+(13*(V^2)^2+8*(V^2)+3)/(96*D^2)
199 FORI=0TO48
200 READ X(I)
201 NEXTI
210 PRINT
220 PRINT"THIS PROGRAM PERFORMS CALCULATIONS NECESSARY FOR"
232 PRINT "TESTING AN UNKNOWN POPULATION MEAN USING SAMPLE"
240 PRINT "STATISTICS. WHAT ARE N (THE SAMPLE SIZE), M (THE"
250 PRINT "SAMPLE MEAN), S (THE SAMPLE STANDARD DEVIATION),"
260 PRINT "W (POPULATION SIZE, ZERO IF INFINITE), AND X (THE"
270 PRINT "POPULATION MEAN TO BE TESTED)";
280 INPUT N,M,S,W,X
290 LET D=N-1
300 PRINT
310 PRINT "  BASED ON THE STUDENT'S T-DISTRIBUTION WITH";D
320 PRINT "  DEGREES OF FREEDOM, THE PROBABILITY OF FINDING"
330 PRINT "  A SAMPLE MEAN THIS MUCH";
340 IF M<X THEN 370
350 PRINT "GREATER";
360 GOTO 380
370 PRINT "LESS";
380 PRINT " THAN THE POPUL-"
390 PRINT "  ATION MEAN IS ";
400 IF W>0 THEN 420
410 LET W=1E25
420 LET S=S*SQR((W-1)/(W*D))
430 LET B1=(M-X)/S
440 LET B1=B1*FNT(B1)
450 GOSUB 530
460 IF B2<.5 THEN 480
470 LET B2=1-B2
480 IF B2<1E-5 THEN 510
490 PRINT 1E-5*INT(.5+1E5*B2)
500 STOP
510 PRINT "LESS THAN 1 IN 100,000."
520 STOP
530 IF B1<-4.5 THEN 640
540 IF B1<0 THEN 610
550 IF B1<4.5 THEN 580
560 LET B2=1
570 GOTO 650
580 GOSUB 660
590 LET B2=Q
600 GOTO 650
610 GOSUB 660
620 LET B2=1-Q
630 GOTO 650
640 LET B2=0
650 RETURN
660 LET Z=10*ABS(B1)
670 LET K=INT(Z)
680 LET D1=Z-K
690 LET Q=X(K)+D1*FND(K+1)+(D1*(D1-1)/2)*(FND(K+2)-FND(K+1))
700 LET Q=1E-6*INT(.5+.1*Q)
710 RETURN
720 END
```