Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50144/conlim.bas
There are 2 other files named conlim.bas in the archive. Click here to see a list.
10	REM  NORMAL CURVE PROBABILITIES:
11	DATA 5000000,5398278,5792597,6179114,6554217,6914625,7257469
12	DATA 7580363,7881446,8159399,8413447,8643339,8849303,9031995
13	DATA 9192433,9331928,9452007,9554345,9640697,9712834,9772499
14	DATA 9821356,9860966,9892759,9918025,9937903,9953388,9965330
15	DATA 9974449,9981342,9986501,9990324,9993129,9995166,9996631
16	DATA 9997674,9998409,9998922,9999277,9999519,9999683,9999793
17	DATA 9999867,9999915,9999946,9999966,9999979,9999987,9999992
18	DIM X(48)
19	DEF FNQ(V)=M+V*S
20	DEF FND(V)=X(V)-X(V-1)
21	DEF FNB(V)=U-V*(V-1)*(D2/(2*D1)+(V-2)*D3/(6*D1))
23	DATA 0,0,0
50	DATA 1E20
100	GOTO 600
200	DATA 3E33
205	DATA .5,.75,.9,.95,.99,.999,.9999,.99999,1E37
210	FOR K1= 0 TO 48
211	READ X(K1)
212	NEXT K1
215	READ I,S1,S2
220	READ H
225	LET I=I+1
230	READ W
235	IF W=3E33 THEN 255
240	LET S1=S1+W
245	LET S2=S2+W^2
250	GOTO 225
255	LET N=I-1
260	PRINT
265	PRINT "VALUES OF SAMPLE STATISTICS:"
270	PRINT
275	PRINT "   SIZE OF SAMPLE",N
280	LET M=S1/N
285	PRINT "   SAMPLE MEAN VALUE",M
290	LET S8=S2/N-M^2
295	PRINT "   VARIANCE OF SAMPLE",S8
300	PRINT "   SAMPLE STD DEVIATION",SQR(S8)
305	LET S5=S8*N*(H-1)/(H*(N-1))
310	PRINT "   ESTIMATED POPN STD DEV",SQR(S5)
315	LET S6=S5*(H-N)/(N*(H-1))
320	LET S=SQR(S6)
325	PRINT "   STANDARD ERROR OF MEAN",S
330	PRINT
335	PRINT
340	PRINT "CONFIDENCE LIMITS ON POPULATION MEAN:"
345	PRINT
350	PRINT "CONF LEVEL","LOWER LIM","UPPER LIM"
355	PRINT
360	READ P
365	IF P=1 E37 THEN 700
370	LET A1=0.5*(1+P)
375	GOSUB 405
395	PRINT 100*P,FNQ(-A2),FNQ(A2)
400	GOTO 360
405	IF A1>0.5 THEN 430
410	LET A1=1-A1
415	GOSUB 450
420	LET A2=-Q
425	GOTO 440
430	GOSUB 450
435	LET A2=Q
440	RETURN
445	REM  REVERSE INTERPOLATION FOR STD NORMAL DEVIATE:
450	LET Z=1E7*A1
455	FOR I=0 TO 45
460	IF Z<X(I) THEN 470
465	NEXT I
470	LET D1=FND(I)
475	LET E1=FND(I+1)
480	LET D2=E1-D1
485	LET D3=FND(I+2)-E1-D2
490	LET U=(Z-X(I-1))/D1
495	LET Q=FNB(FNB(U))
500	LET Q=0.1*(Q+I-1)
505	RETURN
600	PRINT
605	PRINT "THIS PROGRAM COMPUTES CONFIDENCE LIMITS FOR"
610	PRINT "AN UNKNOWN POPULATION MEAN, BASED ON RANDOM"
615	PRINT "SAMPLE DATA GIVEN.   TO USE, TYPE:"
620	PRINT
625	PRINT "   50  DATA  (SIZE OF POPULATION)"
630	PRINT "      (OMIT THIS INPUT IF INFINITE POP'N)"
635	PRINT "   100 DATA  X(1), X(2),.....,X(N)"
640	PRINT
645	PRINT "WHERE THE (I) ARE THE SAMPLE OBSERVATIONS."
700	END