MATH 214 Lab 9: Confidence Intervals Today you will explore confidence intervals. You will generate many random samples from different populations and calculate confidence intervals. You will see what happens to the length of the confidence interval as you change sample size. Observe how the population distribution affects the confidence intervals and confidence levels. Consider a random sample of size n 30 from a distribution with mean and standard deviation . We 2 2 have seen in class that P( <(X - )< ) = .9544, approximately. n n Explain why this is true, using words like z-score, standard normal, sampling distribution, and Central Limit Theorem. By rearranging terms, P( X P( X - 2 n < < X+ 2 n 2 n < < X+ 2 n ) = P( 2 n <(X - )< 2 n ) , so that ) = .9544, approximately. Thus it can be deduced that there is approximately a 95% chance that the random interval 2 2 2 2 (X , X+ ) will contain , where X is the lower limit and X + is the upper limit. n n n n In what way is it appropriate to refer to ( X - 2 n , X+ 2 n ) as a “random interval”? Also, if n is large enough, (n 30), the population standard deviation, can be estimated by the sample standard deviation, s. Thus, the probability that the random interval 2s 2s (X , X+ ) n n will contain will still be approximately 95%. To study the above statements we will use the Confidence Interval applet to generate upper and lower limits from many random samples of size N = 10, 30, and 50 from Normal, Exponential, and Poisson distributions. Go to http://faculty.salisbury.edu/~bawainwright/applets/home.html. Click on the Applets link from the index, and click on Confidence Interval Experiment to open the applet. Notice that the distribution is already set to Normal. Click the arrow beside 90 and select 95 from the dropdown menu. Slowly use the slide bars to adjust the mean of the population, μ, and standard deviation, σ. Comment on the effect of this on the scale of the graph. Now slowly increase the sample size. What effect does this have on the scale of the graph? Why? Part I. Suppose that the distribution of weights of bags of peanuts is approximately normal with a mean weight of 5 oz. and a standard deviation of 0.5 oz. First, we’ll use the applet to generate and plot upper and lower confidence limits for simulated samples of size 50 from this population. To do so, select 5 for the mean and 0.5 for the standard deviation of the population. Select N=50 for the Sample Size. Click the “Play” button that has a single arrow on it: ►. This generates one sample, calculates the confidence interval from that sample, and plots it vertically on the graph. In the graph, the x marks the location of the sample mean. The two black dots mark the location of the upper (Right) and lower (Left) limits of the interval. Notice that all these are also recorded in the table. Click “Play” several more times until one of your intervals is a different color than the others. Intervals which surround the population mean are drawn in red, while intervals which do not are drawn in blue. Why are some intervals narrower than others? Click the dropdown menu beside the number 10 and select 100. This means we will be selecting 100 samples of size 50 and for each of these samples a confidence interval will be constructed. To execute this task, Click the “Fast-Forward” button: ►►. What percentage of your intervals contained the true population mean? Interpret, in a complete sentence, one Confidence Interval generated for this population. Be sure your interpretation addresses the population and variable of interest. Repeat the above experiment using sample sizes of 30 and 10. You can skip the part where the applet selects one sample at a time. What percent of the intervals contain the true mean, μ = 5? How do the intervals using samples of size N=10, 30 and 50 compare (length of interval, percentage of intervals that capture the true mean, etc.)? Summarize your findings after you fill in the following table: Population is normally distributed with mean µ=5 Sample size Proportion of CI containing population mean µ=5 n=10 n=30 n=50 Part of the reason that the N=10 and 30 samples don’t do as well as the N=50 intervals is the fact that we are using s to estimate σ. Part II. For a certain type of halogen light bulb, X, the life-length of a new halogen bulb is distributed exponentially with a mean of 3 months. Generate and Plot Upper and Lower Limits for 100 simulated samples of size 10 from this population. You will need to change Normal to Exponential, set mean equal to 3 and sample size to 10. Once again you will need to change the number of samples from 10 to 100 as you did in part I (if it is not still set on 100). Interpret, in a complete sentence, one Confidence Interval generated for this population. Be sure your interpretation addresses the population and variable of interest. Use the graph to determine what proportion (percentage) of the intervals contain = 3. How does this compare to what you calculated above, where it was determined that there is approximately a 95% 2s 2s chance that the random interval ( X , X+ ) will contain ? n n Interpret, in a complete sentence, one Confidence Interval generated for this population. Be sure your interpretation addresses the population and variable of interest. Now repeat the process for sample sizes 30 and 50. Summarize your findings after you fill in the following table: Population is exponentially distributed with mean µ=3. Sample size Proportion of CI containing population mean µ=3 n=10 n=30 n=50 Part III. Suppose that the number of crimes reported from the Covered Bridge neighborhood in Fruitland has a Poisson distribution, with mean 5. Generate and Plot Upper and Lower Limits for 100 simulated samples of size 10, 30 and then 50 from this population. Interpret, in a complete sentence, one Confidence Interval generated for this population (for all sample sizes). Be sure your interpretation addresses the population and variable of interest. What percentage of the intervals contains the true population mean? How does this compare to what you calculated above, where it was determined that there is approximately a 95% chance that the random interval contains the population mean? Summarize your findings after you fill in the following table: Population follows Poisson distribution with mean µ=5. Sample size Proportion of CI containing population mean µ=5 n=10 n=30 n=50 Part IV. Answer the following questions in your report: Discuss the accuracy or meaning of the statement: “A 95% confidence interval contains the mean of the population.” What can you say about the relationship between the width of a confidence interval and the sample size? Discuss how the distribution of the population affects the confidence interval (based upon your results above). That is, does distribution of population matter when we construct a confidence interval? Pay attention to the sample size as well.