| Basic Commands |
Probability Puzzles |
Hypothesis Test, Count Data |
Hypothesis Test, Measured Data |
Confidence Interval, Count Data |
Confidence Interval, Measured Data |
Association / Correlation |
Regression |
Other Examples |
Cancer Medicine Effectiveness
A new medicine produced 5 cures in 6 patients, while a placebo produced cures in only 2 in 6. If the medicine is ineffective, what is the probability that this difference might occur by chance. We will generate two samples (6 random numbers between 1 and 12) and count the number of cures in each (our benchmark or null hypothesis is that both the placebo and medicine produce an overall cure rate of 7 in 12, so we let the numbers 1-7 represent cures).
URN 7#1 5#0 a
constitute the null universe
REPEAT 1000
SAMPLE 6 a b
take two samples like those observed, from the null model
SAMPLE 6 a c
COUNT b =1 bb
count the number of cures
COUNT c =1 cc
SUBTRACT bb cc d
what's the difference in # of cures?
SCORE d z
keep score
END
HISTOGRAM z
COUNT z >=3 k1
how often a difference of 3 cures in either direction?
COUNT z <=-3 k2
ADD k1 k2 k
DIVIDE k 1000 kk
PRINT KK