Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Lecture #13: Confidence Intervals for the Mean Inferential Statistics Having covered descriptive statistics and then probability, we are now embarking on the most significant part of the course – inferential statistics. There are two main ways in which we make inferences (draw conclusions about populations from samples). The first is estimation, which we’ll cover this lecture and next, and the second is the testing of claims, which we’ll do on and off for the rest of the course. Point Estimate for the Mean Let’s say we’re interested in guessing (inferring) the population mean shoe size for Mendocino College students from our Class Data Base. For that group of 95, x 8.953 . What should we guess for , the population mean? I don’t see how we could do better than 8.953. It’s not as though the 95 students in the class data base were chosen for the size of their feet. In fact, to do all of the analyses we’re going to make, we must assume that the Class Data Base represents a random sample of Mendocino College students. When we guess a parameter ( ) by picking a single number like x 8.953 , we are making what’s called a point estimate. So we say that x is the point estimate for . If we’re not going to use x (because maybe we have some other, better information), why did we bother to collect the data in the first place? The Margin of Error But what if some other group of 95 made up the Class Data Base? It’s very unlikely that this group would have a sample mean of 8.953, although we would expect this mean to be reasonably close to 8.953. Think of a sampling distribution with samples 1 of size 95, each having its own sample mean. Our Class Data Base happens to contain one such sample. So what we do, instead of limiting ourselves to a point estimate, is to create what’s called a confidence interval by employing a number called E, and saying that we are confident to a certain degree (which we will go into in great detail) that the population mean falls between x E and x E . We could also use the double inequality notation of algebra: x E x E . This expresses the idea that has been captured, or pinpointed, between the two extremes of x E and x E . E is called the maximum error of estimate or the margin of error and is sometimes abbreviated ME. In a bit I’ll give you a formula for the margin of error, but first I’d like to try to give you a feel for it and the concept of confidence. What if I just pick 5 as the margin of error? In the shoe size example, that would mean 8.953 5 8.953 5 , or 3.953 13.953 . In other words, the average shoe size of Mendocino College students is somewhere between a 4 and a 14. How confident am I that this statement is true? One hundred percent confident! I would stake my life on it, if need be. But the statement is of absolutely no use. It gives no information. Let’s say you were marketing a new kind of slipper with college logos, and you wanted to know what sizes to make. The population mean might turn out to be 6, or 13. I’d like to use a smaller E. How about 0.2? That would mean 8.953 0.2 8.953 0.2 , or 8.753 9.153 . Perfect! This interval contains only one actual shoe size, 9. So I would produce a lot of size 9’s, and some in sizes smaller and larger than 9, but centered around size 9. But how sure could I be that I had really captured ? Not anywhere near as confident as I was about the wider interval. I hope 2 you get the sense that the narrower the interval (the smaller the margin of error, E) the more useful it is, but the less confident you become that you’ve actually captured the population mean. It’s a trade-off. Do you want to be surer (or at least less unsure) that you’ve bracketed ? Widen the interval; increase E. To get a formula for E, we need to develop some new notation. We call the number that expresses our confidence that we captured the mean the confidence level, or CL. We can pick this level. There are three levels that are usually used: 99%, if the matter is really important and we want to be quite certain; 90%, if it’s not a big deal; 95% if it’s in between. Can you see that E will be largest for a 99% CL and smallest for 90%? Now subtract CL from 1, or 100%. For the 99% confidence level, this would give 1 0.99 0.01. We call this , the Greek ‘a,’ pronounced alpha. You’ll be seeing a lot of . For the 95% confidence level it would be 1 0.95 0.05 , for 90% 1 0.90 0.10 . Rearranging the equations, we see that the confidence level CL is actually 1 . Think now of the Central Limit Theorem, which says that the sampling distribution of samples of size 95 will be normal, with the same mean as the parent population. I want to go left and right from this mean a certain distance along the x axis so that the area under the normal curve is equal to the confidence level. That leaves of the area outside my limits. Since the curve is symmetrical, that gives an area of under the curve on either side of the limits: 3 2 (If you’re very perceptive, you might notice that we’re playing fast and loose with x and here, but it’s better if you just accept it.) At this point I have to introduce you to a certain special normal distribution. We call it the z distribution, or the standard normal distribution. It has a mean of 0 and a standard deviation of 1. You’ve been able to avoid it up until now because we used a calculator to find probabilities and cut-offs for normal distributions. Of course you have seen the letter z used in the z-scores or standard scores introduced in Lecture #6. The standard normal distribution is centered around 0, so half its values are negative and half are positive. We now give a special name to the limits of the confidence interval in the z distribution. We call them z and z . They are the cut-offs in the z distribution for 2 2 the middle CL = 1 of the area. Let me redo the figure above for the z distribution 4 In order to get a formula for E, we need to be able to calculate z . We’ll do this 2 for our three confidence levels, 90%, 95% and 99%, but once having done this we will be able just to use the three values of z whenever the need arises. 2 Let’s start with the 99% confidence level, for which 1 0.99 0.01 , and thus 0.01 0.005 . Here’s the diagram: 2 2 We can calculate z by using invNorm (0.005, 0, 1) 2.5758 , or 2.576 . Of 2 course z = invNorm (0.995, 0, 1) 2.5758 , or 2.576. Either way, for a confidence 2 level of 99%, we will use 2.576 for z . 2 Similar calculations (invNorm (0.975, 0, 1) for a 95% confidence level, and invNorm (0.95, 0, 1) for a 90% confidence level) yield values for z of 1.960 and 1.645. 2 Here’s a table that summarizes what we’ve done: Confidence Level 2 z 2 99% 0.01 0.005 2.576 95% 0.05 0.025 1.960 90% 0.10 0.05 1.645 5 In practice, all you need at your disposal are the first and last columns: Confidence Level z 99% 2.576 95% 1.960 90% 1.645 2 Now at long last you’re ready for the formula for E. Doing some mathematical rearranging, which, believe me, you don’t want to see, we get E z x , where x is 2 the standard error of the mean, from Lecture #12, pertaining to the sampling distribution of the x ’s. The formula for the sampling error was x x n . So E z x 2 n . Since x is the population standard deviation of the parent population, which of course we don’t know (if we knew that we’d most likely know the population mean and wouldn’t have to estimate it!), so we’ll use s, the sample standard deviation, instead, which we can do if n is big enough, because of the Central Limit Theorem. This gives us our final version of E: E z s 2 n . (It’s final if we’re estimating the mean. When we’re estimating some other parameter, as you’ll see in the next lecture, there’s a different formula.) Constructing Confidence Intervals Using the formula, let’s now make a 99% confidence interval for the mean shoe size of Mendocino College students. Remember, its form is x E x E . In our 6 case, this becomes 8.953 2.576 to 2.576 1.939 95 1.939 95 8.953 2.576 1.939 95 . E itself comes out 0.512 , and when the dust settles we have 8.441 9.465 , and that’s the answer, the 99% confidence interval for the true population mean shoe size of Mendocino College students. As you can see, this interval contains two actual shoe sizes, 8½ and 9. The calculator is a far easier way of constructing confidence intervals. We use ZInterval and put s in for . Here are the results for the three levels of confidence: 99%: 8.440 9.465 95%: 8.563 9.343 90%: 8.625 9.280 Notice again that the higher the level of confidence the wider the interval. As the level of confidence decreases, the range of possible means narrows. At our two lowest levels, 95% and 90%, the intervals contain only one possible shoe size. That reminds me of our made-up margin of error, 0.2, which had the advantage of making an interval containing only one size. What level of confidence did that E come from? This question turns out to be pretty easy. Look at the diagram: 7 The confidence level is the shaded area, or normalcdf (8.753, 9.153, 8.953, 1.939 95 ) 0.685 . So the confidence level for this margin of error is about 69%, really too low to be of much use. What exactly does it mean to say that we are, for instance, 99% confident that the true mean shoe size of Mendocino College students is between 8.440 and 9.465? (By the way, another method of stating these intervals is to give the mean as x E , in this case 8.953 0.513 . This has the advantage of including the values of the sample mean and the margin of error, but it lacks the limits of the interval.) The population mean exists; we just don’t know what it is. We take a sample, find its mean, and go down from it and up from it (left and right actually) a certain distance, E, to form an interval. This diagram shows one such interval: 8 This interval did include the population mean . Let’s say we generate other samples of the same size and make intervals with them: Some of the intervals contain , and some, like the fourth one down, don’t. If you are generating a 99% confidence interval, this means that on the average 99 out of a 100 such intervals will contain , and one won’t. Of course, you have no idea if the one you generated got lucky or not. But you do know that the higher the level of confidence you use, the more likely it is that your interval does contain . And even if your interval missed , it probably didn’t miss it by much. The diagram also illustrates the reason why a higher confidence level means a wider interval: the longer the horizontal line, the more likely it is that the line crosses the dotted line for . 9 Sample Size There are certainly reasons we might want to limit the margin of error to a certain size, as illustrated by our example, in order to pinpoint the population mean. But how can we do this without lowering the confidence level and hence decreasing z ? Our 2 sample standard deviation, s, is what it is and can’t be shrunk. Where else in the formula E z s 2 n can we look for relief? Clearly, our only other hope is n, the sample size. Since n is in the denominator, increasing it will decrease E. This leads us to the sample size formula for estimating the mean. In it, we know the confidence level and the sample standard deviation, and we want to know what sample size will produce a confidence interval with the desired margin of error. Here’s a little algebraic manipulation, turning the formula E z solved for E, into an equivalent formula solved for n: s E z 2 n 2 2 Square both sides: 2 z s E2 2 . n giving Multiply both sides by and simplify. Presto: n : E2 z s n n 2 2 E 2 n E2 E z s n 2 E 2 10 2 s 2 n , currently For example, what if we want to estimate the population mean shoe size of Mendocino College students within one-fourth of a size at the 90% confidence level? z s With E 0.25 the sample size formula n 2 then becomes E 2 1.645 1.939 n 162.78 . We can’t include 0.78 of a person, so we round our 0.25 2 answer to 163. A sample size of 163 will ensure that we estimate the mean within onefourth of a size at the 90% confidence level. Even if our sample size answer wouldn’t normally round up, we do so anyway, because the n we get is the absolutely smallest number that will fulfill the condition of estimating within a certain margin of error at a certain level of confidence. If we were to round down we would be below this limit. What if we wanted to find the sample size needed to estimate the mean shoe size within one size at the 95% confidence level? In 2 z s 1.960 1.939 2 this case, n becomes n 14.44 . We have to round this E 1 2 up, as explained above, so the answer is a sample size of 15. © 2009 by Deborah H. White 11