30 PRINT" This theorem is especially valuable in evaluating the prior probability":PRINT " of disease given a certain symptom, sign or laboratory result."
35 PRINT:PRINT:PRINT "Do you want to evaluate the: ":PRINT
40 PRINT TAB(12);"1.) Probabilities of False Positive and False Negative tests":PRINT
45 PRINT TAB(12);"2.) Probability of Disease given a Positive test"
50 LOCATE 15,25:PRINT "Enter choice:":AR=15:AC=39:GOSUB 4800:ASUB=VAL(IP$):IF ABS(1.5-ASUB)>0.5 THEN BEEP:GOTO 50
55 CLS:ON ASUB GOTO 60,115
60 PRINT TAB(12);"PROBABILITIES OF FALSE POSITIVE AND FALSE NEGATIVE TESTS":PRINT TAB(12);STRING$(56,205):PRINT
65 INPUT " What is the NAME of the disease or condition being tested for? ",D(1)
70 DQ="What is the probability of a POSITIVE test":PRINT TAB(5);DQ:PRINT TAB(37);:PRINT "when a person has ";D(1);:INPUT PT:IF ABS(PT-0.5)>=0.5 THEN GOSUB 215:GOTO 70
90 PRINT TAB(8);"Enter estimated incidence of ";D(1):PRINT TAB(10);:INPUT "in the population in which the test is used (PER/10,000) = ",PD:IF PD>10000 THEN BEEP:GOTO 90
105 PRINT TAB(10);"The probability of a FALSE POSITIVE result is ";PP;TAB(80):PRINT:PRINT
110 PRINT TAB(10);"The probability of a FALSE NEGATIVE result is ";PN;TAB(80):COLOR CLR1,CLR2:GOTO 195
115 PRINT TAB(19);"PROBABILITIES OF DISEASE GIVEN A POSITIVE TEST":PRINT TAB(19);STRING$(46,205):PRINT
120 PRINT TAB(5); "What is the name of the SYMPTOM COMPLEX, PHYSICAL FINDING,": PRINT TAB(27);:INPUT "or LABORATORY TEST under consideration? ",T$
125 PRINT TAB(5);"In the tested population, HOW MANY DISEASES exist ":PRINT TAB(33);:INPUT "in which this test can be positive? ",N:PRINT
130 ERASE PT,PD,D:DIM PT(N),PD(N),D(N):TF=0
135 PRINT TAB(15);" PERCENT of people PROBABILITY of a "
140 PRINT TAB(15);" in tested population + test in people"
145 PRINT TAB(15);"who have this disease: known to have"
150 PRINT TAB(3);"DISEASE (SUM must = 100%) this disease:": PRINT
155 FOR Z=1 TO N:PRINT Z;:IF TF=1 THEN PRINT D(Z); ELSE INPUT;"",D(Z)
160 PRINT TAB(24);:INPUT;"",P:PD(Z)=P*0.01:PRINT TAB(46);:INPUT "",PT(Z):NEXT Z
165 SP=0:FOR Z=1 TO N:SP=SP+PD(Z)*PT(Z):NEXT
170 LOCATE 9,60:COLOR CLR2,CLR1:PRINT " PROBABILITY of ":LOCATE 10,60:PRINT " this disease in ":LOCATE 11,60:PRINT " a person with a ":LOCATE 12,60:PRINT " positive test: ":GOSUB 210
175 FOR Z=1 TO N:LOCATE 13+Z,66:PRINT USING ".######";PD(Z)*PT(Z)/SP:NEXT
180 COLOR CLR1,CLR2:LOCATE 24,1:PRINT "Would you like to modify these calculations in relation to";
185 LOCATE 25,34:INPUT;"the SAME TEST and the SAME DISEASES? ",A$
190 IF A$="y" OR A$="Y" THEN TF=1:CLS:LOCATE 4,30:PRINT "TEST = ";T$:LOCATE 9,1:GOTO 135
195 LOCATE 24,1:PRINT TAB(80):LOCATE 25,1:PRINT TAB(79):LOCATE 25,12:INPUT;"Do you want another calculation using Bayes' Theorem? ",A$
200 IF A$="Y" OR A$="y" THEN 20
205 GOTO 3000
210 PLAY "MS O3 L64 G O2 GE L9 E":RETURN
215 BEEP:AR=CSRLIN:LOCATE 25,15:PRINT "Probability should be a fraction between 0 and 1.";:LOCATE AR,1:RETURN
5000 BEEP:IF ERR<>53 AND ERR<>71 THEN 5010 ELSE LOCATE 2,10:PRINT "Please place EPISTAT in drive A: (or other default).":PRINT TAB(25);"Press any key to continue:"