Chapter 6: Confidence Intervals and Hypothesis Testing When analyzing data, we can’t just accept the sample mean or sample proportion as the official ˆ (sample mean and sample mean or proportion. When we estimate the statistics x , p proportion), we get different answers due to variability. So we have to perform statistical inference: ‐ Confidence Interval: when you want to estimate a population parameter ‐ Significance Testing: when we want to assess the evidence provided by the data in favor of some claim about the population. Section 6.1: Confidence Intervals ‐allow us to estimate a range of values for the population mean or proportion. The true mean or proportion for the population exists and is a fixed number, but we don’t know it! Using sample statistics we get an estimate of where we expect the population parameter to be. If we take a single sample, our single confidence interval “net” may or may not include the population parameter. However if we take many samples of the same size and create a confidence interval from each sample statistic, over the long run 95% of our confidence intervals will contain the true population parameter (if we are using a 95% confidence level). 1 If you increase your sample size (n), you decrease your margin of error If you increase your confidence level (C), then you increase your margin of error A smaller margin of error is good because we get a smaller range of where to expect the true population parameter. Confidence interval formulas look like estimate margin of error. We write the intervals as (lower bound, upper bound). 2 Confidence Interval for a Population Mean, : x z* x n where z* is the value on the standard normal curve with are C between –z* and z*. z* 1.645 1.960 2.576 C 90% 95% 99% (Table D in the back of the book contains more values, but these are the most common) Sample Size, n, for Desired Margin of Error, m: z * x n m 2 Note that it is the sample size, n, that influences the margin of error. The population size has nothing to do with it. Ways to reduce your margin of error: 1.) Increase sample size 2.) Use a lower level of confidence (smaller C) 3.) Reduce x x z* x n under certain circumstances: Be careful!!!! You can only use the formula Data must be an SRS from the population. Do not use if the sampling is anything more complicated than an SRS. Data must be collected correctly (no bias). The margin of error covers only random sampling errors. Undercoverage and nonresponse are not covered. Outliers can have a big effect on the confidence interval. (This makes sense because we use the mean and standard deviation to get a CI.) You must know the standard deviation of the population, x . 3 EXAMPLE 1: A questionnaire of spending habits was given to a random sample of college students. Each student was asked to record and report the amount of money they spent on textbooks in a semester. The sample of 130 students resulted in an average of $422 with standard deviation of $57. a) Give a 90% confidence interval for the mean amount of money spent by college students on textbooks. b) Is it true that 90% of the students spent the amount of money found in the interval from part (a)? Explain your answer. c) What is the margin of error for the 90% confidence interval? d) How many students should you sample if you want a margin of error of $5 for a 90% confidence interval? 4 EXAMPLE 2: A sample of 12 STAT 301 students yields the following Exam 1 scores: 78 62 99 85 94 53 88 90 86 92 75 92 Assume that the population standard deviation is 10. The sample mean can be calculated using SPSS or calculator to be 82.83. (Note: Do NOT use any SPSS confidence intervals—they are good only for Chapter 7, not this type of CI. You must get these Z confidence intervals by hand.) a) Find the 90% confidence interval for the mean score for STAT 301 students. b) Find the 95% confidence interval. c) Find the 99% confidence interval. d) How do the margins of error in (b), (c), and (d) change as the confidence level increases? Why? 5 Section 6.2: Hypothesis Testing The 4 steps common to all tests of significance: 1. State the null hypothesis H0 and the alternative hypothesis Ha. 2. Calculate the value of the test statistic. 3. Draw a picture of what Ha looks like, and find the P‐value. 4. State your conclusion about the data in a sentence, using the P‐value and/or comparing the P‐value to a significance level for your evidence. STEP 1: State the null hypothesis H0 and the alternative hypothesis Ha. To do a significance test, you need 2 hypotheses: H0, Null Hypothesis: the statement being tested, usually phrased as “no effect” or “no difference”. Ha, Alternative Hypothesis: the statement we hope or suspect is true instead of H0. Hypotheses always refer to some population or model. Not to a particular outcome. Hypotheses can be one‐sided or two‐sided. One‐sided hypothesis: covers just part of the range for your parameter H0: = 10 OR H0: = 10 Ha: < 10 Ha: > 10 Two‐sided hypothesis: covers the whole possible range for your parameter H0: = 10 Ha: 10 Even though Ha is what we hope or believe to be true, our test gives evidence for or against H0 only. We never prove H0 true, we can only state whether we have enough evidence to reject H0 (which is evidence in favor of Ha, but not proof that Ha is true) or that we don’t have enough evidence to reject H0. 6 Example (Exercise 6.37, p. 418): Each of the following situations requires a significance test about a population mean . State the appropriate null hypothesis H0 and alternative hypothesis Ha in each case: a. Census Bureau data shows that the mean household income in the area served by a shopping mall is $72,500 per year. A market research firm questions shoppers at the mall to find out whether the mean household income of mall shoppers is higher than that of the general population. b. Last year, your company’s service technicians took an average of 1.8 hours to respond to trouble calls from business customers who had purchased service contracts. Do this year’s data show a different average response time? STEP 2: Calculate the value of the test statistic. A test statistic measures compatibility between the H0 and the data. The formula for the test statistic will vary between different types of problems. In problems like those we studied in Chapter 6, the test statistic will be the Z‐score. STEP 3: Draw a picture of what Ha looks like, and find the P‐value. P‐value: the probability, computed assuming that H0 is true, that the test statistic would take a value as extreme or more extreme than that actually observed due to random fluctuation. It is a measure of how unusual your sample results are. The smaller the P‐value, the stronger the evidence against H0 provided by the data. Calculate the P‐value by using the sampling distribution of the test statistic (only the normal distribution for Chapter 6). STEP 4: Compare your P‐value to a significance level. State your conclusion about the data in a sentence. Compare P‐value to a significance level, . If the P‐value , we can reject H0. If you can reject H0, your results are significant. If you do not reject H0, your results are not significant. 7 Z‐Test for a Population Mean To test the hypothesis H0: = 0 based on an SRS of size n from a population with unknown mean and known standard deviation , Z0 x 0 / n compute the test statistic: the P‐values for a test of H0 against: Ha: > 0 is P( Z Z0) Ha: < 0 is P( Z Z0 ) Ha: 0 is 2* P( Z | Z0| ) These P‐values are exact if the population is normally distributed, and are approximately correct for large n in other cases. 8 EXAMPLES 1. Last year the government made a claim that the average income of the American people was $33,950. However, a sample of 50 people taken recently showed an average income of $34,076 with a population standard deviation of $324. Is the government’s estimate too low? Conduct a significance test to see if the true mean is more than the reported average. Use an =0.01. 2. An environmentalist collects a liter of water from 45 different locations along the banks of a stream. He measures the amount of dissolved oxygen in each specimen. The mean oxygen level is 4.62 mg, with the overall standard deviation of 0.92. A water purifying company claims that the mean level of oxygen in the water is 5 mg. Conduct a hypothesis test with =0.001 to determine whether the mean oxygen level is less than 5 mg. 3. An agro‐economist examines the cellulose content of a variety of alfalfa hay. Suppose that the cellulose content in the population has a standard deviation of 8 mg. A sample of 15 cuttings has a mean cellulose content of 145 mg. A previous study claimed that the mean cellulose content was 140 mg. Perform a hypothesis test to determine if the mean cellulose content is different from 140 mg if =0.05. 9 How does relate to confidence intervals? If you have a 2‐sided test, and if the and confidence level add to 100%, you can reject H0 if 0 (the number you were checking) is not in the confidence interval. a) Find a 95% confidence interval for the mean cellulose content from the above example. b) Now try the test from part number 3 again using the confidence interval from part b to do the hypothesis test. (The result should be the same.) Annual Drinking Water Quality Report, 2004, Town of Brookston, IN “I’m pleased to report that our drinking water is safe and meets federal and state requirements.” Test Results (MCL is the maximum contaminant level, the highest level of a contaminant that is allowed in drinking water.) Contaminant Violation Y/N Level Detected Unit measurement MCL Beta/photon emitters N 2.1 3.2 mrem/yr 4 Alpha emitters N 0 1.6 pCi/l 15 Barium N 0.216 ppm 2 Copper N 0.039 to 0.453 ppm 1.3 Fluoride N 0.01 ppm 4 Sodium N 0.0 ppm N/A One of these violation reports should actually be a “yes” instead of a “no.” Which one is it and why? What hypotheses go along with these confidence intervals? Note: When I called the town of Brookston office to ask them about this, the water manager called the state EPA office to get more information. What they told him was that, yes, technically I was correct, but that they don’t use the confidence intervals that are reported. Apparently these are the FEDERAL EPA rules. They only use the mean. I tried to get sample size or other information, but I wasn’t able to learn anything more. 10 P‐values can be more informative than a reject/do not reject H0 based on . As P‐value gets smaller the evidence for rejecting H0 gets stronger. Just because we use = 0.05 a lot doesn’t mean that’s the level you have to use—it’s just the most common. There’s nothing particularly special about that level. In a large sample, even tiny deviations from the null hypothesis can be important. If we fail to reject H0, it may be because H0 is true or because our sample size is insufficient to detect the alternative. Plot your data and look at your P‐value to determine your conclusions. Could outliers be part of the problem? A confidence interval actually estimates the size of an effect rather than simply asking if it is too large to reasonably occur by chance alone. You must have a well‐designed experiment in order for statistical inference to work. Randomization is important. 11
© Copyright 2024