Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0025/condif.bas
There are 2 other files named condif.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 9192833,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)=M3+V*R3
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))
22 DEF FNZ(V)=1+((V^2)+1)/(4*D+(((V^2)+3)*(5*(V^2)+1))/(96*D^2))
100 GO TO 352
200 DATA .5,.75,.9,.95,.99,.999,.9999,.99999,4E37
201 FOR I=0TO48
202 READ X(I)
203 NEXTI
204 READ H1,N1,M1,S1,H2,N2,M2,S2
206 IF H1<>0 THEN 210
208 LET H1=1E20
210 IF H2<>0 THEN 214
212 LET H2=1E20
214 LET M3=M1-M2
216 LET T1=S1*SQR((N1*(H1-1))/(H1*(N1-1)))
218 LET T2=S2*SQR((N2*(H2-1))/(H2*(N2-1)))
220 LET R1=T1*SQR((H1-N1)/(N1*(H1-1)))
222 LET R2=T2*SQR((H2-N2)/(N2*(H2-1)))
224 LET R5=R1^2
226 LET R6=R2^2
228 LET R3=SQR(R5+R6)
230 LET W=R5/(R5+R6)
232 LET D=((N1-1)*(N2-1))/((N2-1)*W^2+(N1-1)*(1-W)^2)
234 LET D=INT(.5+.1*INT(10*D+.5))
236 PRINT
238 PRINT " STATISTIC ","SAMPLE 1","SAMPLE 2"
240 PRINT
242 PRINT "SAMPLE MEAN ",M1,M2
244 PRINT "SAMPLE VARIANCE ",S1^2,S2^2
246 PRINT "SAMPLE STD DEVIATION",S1,S2
248 PRINT "SAMPLE SIZE ",N1,N2
250 PRINT "POPULATION SIZE ",
252 IF H1<>1E20 THEN 258
254 PRINT "INFINITE",
256 GOTO 260
258 PRINT H1,
260 IF H2<>1E20 THEN 266
262 PRINT "INFINITE"
264 GOTO 268
266 PRINT H2
268 PRINT "ESTIM POPN STD DEV ",T1,T2
270 PRINT "STD ERROR OF MEAN ",R1,R2
272 PRINT
274 PRINT "DIFF BETWEEN MEANS "," ";M3
276 PRINT "STD ERROR OF DIFF "," ";R3
278 PRINT "DEGR OF FREEDOM (DIFF)"," ";D
280 PRINT
282 PRINT
284 PRINT "CONFIDENCE LIMITS ON DIFFERENCE BETWEEN MEANS:"
286 PRINT
288 PRINT "CONF LEVEL","LOWER LIM","UPPER LIM"
290 PRINT
292 READ P
294 IF P=4E37 THEN 386
296 LET A1=0.5*(1+P)
298 GOSUB 310
300 IF D=0 THEN 306
302 REM FNZ CONVERTS STUDENT'S T TO A NORMAL DEVIATE:
304 LET A2=A2*FNZ(A2)
306 PRINT 100*P,FNQ(-A2),FNQ(A2)
308 GOTO 292
310 IF A1>0.5 THEN 320
312 LET A1=1-A1
314 GOSUB 328
316 LET A2=-Q
318 GOTO 324
320 GOSUB 328
322 LET A2=Q
324 RETURN
326 REM REVERSE INTERPOLATION FOR STD NORMAL DEVIATE:
328 LET Z=1E7*A1
330 FOR I=0 TO 45
332 IF Z<X(I) THEN 336
334 NEXT I
336 LET D1=FND(I)
338 LET E1=FND(I+1)
340 LET D2=E1-D1
342 LET D3=FND(I+2)-E1-D2
344 LET U=(Z-X(I-1))/D1
346 LET Q=FNB(FNB(U))
348 LET Q=0.1*(Q+I-1)
350 RETURN
352 PRINT
354 PRINT "THIS PROGRAM COMPUTES CONFIDENCE LIMITS FOR"
356 PRINT "THE DIFFERENCE BETWEEN TWO POPULATION MEANS,"
358 PRINT "BASED ON DATA SUPPLIED FOR TWO SAMPLES, ONE"
360 PRINT "FROM EACH POPULATION. TO USE, TYPE:"
362 PRINT
364 PRINT " 100 DATA H1,N1,M1,S1, H2,N2,M2,S2"
366 PRINT " RUN"
368 PRINT
370 PRINT "WHERE H1 = SIZE OF POPULATION 1 (LET H1"
372 PRINT " EQUAL ZERO IF POPN IS INFINITE)"
374 PRINT " N1 = SIZE OF SAMPLE 1"
376PRINT " M1 = ARITHMETIC MEAN OF SAMPLE 1"
378 PRINT " S1 = STANDARD DEVIATION OF SAMPLE 1"
380 PRINT " (BASED ON DIVISOR OF N1)"
382 PRINT
384 PRINT "AND H2,N2,M2,S2 ARE THE SAME FOR SAMPLE 2."
386 END