Extra Exercise 11 ----------------- PSLS Confidence Intervals applet. Sampling 95% confidence intervals and recording the number of intervals that contain the true parameter (X) corresponds to a binomial setting. For this exercise, we sample 25 intervals. Therefore X follows B(25,0.95). By the rules of the binomial distribution, EX = 25*0.95 = 23.75. We run 30 replications of the experiment: observations X1,...,X30. These observations are independent and all follow B(25,0.95). The average, Xmean, is an unbiased estimate for the true mean and its distribution narrows more down around the true mean if we take more than 30 samples. For one run of the experiment (30 replications), the following results were obtained (for convenience displayed using Minitab). The counts ("Hit") for the 30 replications were typed into column 1. name c1 'hits' Stem-and-Leaf 'hits'. Stem-and-leaf of hits N = 30 Leaf Unit = 0.10 1 20 0 2 21 0 6 22 0000 (11) 23 00000000000 13 24 000000000 4 25 0000 Describe 'hits'. Variable N N* Mean SE Mean StDev Minimum Q1 Median Q3 Maximum hits 30 0 23.267 0.214 1.172 20.000 23.000 23.000 24.000 25.000 Comments: -------- The sample mean is somewhat lower than the population mean of 23.75. The distribution of hits appears clearly left-skewed, as one would expect for a binomial distribution with p close 1. Addition: --------- In order to compare the stem and leaf plot with the theoretical B(25,0.95) distribution, we compute the probabilities for counts in the range 18-25. Name c2 "x" Set 'x' 1( 18 : 25 / 1 )1 End. Name c3 "px" PDF 'x' 'px'; Binomial 25 .95. Name C4 'expected' Let 'expected' = 30*'px' Print 'x' 'px' 'expected'. Data Display Row x px expected 1 18 0.000149 0.0045 2 19 0.001044 0.0313 3 20 0.005952 0.1786 4 21 0.026926 0.8078 5 22 0.093016 2.7905 6 23 0.230518 6.9155 7 24 0.364986 10.9496 8 25 0.277390 8.3217 Comments: --------- It is seen that the sample distribution has too many counts of 22 and 23 and too few counts of 24 and 25, thus leading to a lower sample mean than the correct mean of the distribution. This could however just be random fluctuation that would smooth out if more than 30 trials were done. You could also directly generate a plot of the binomial distribution using the Graph-Probability Distribution Plot menu: DPlot; Distribution; Binomial 25 .95.