510 likes | 797 Views
Chapter 9. Hypothesis Testing Null and Alternative Hypotheses and Errors in Testing Large Sample Tests about a Mean: Rejection Points Small Sample Tests about a Population Mean Hypothesis Tests about a Population Proportion. Introduction. A Hypothesis Test is a statistical procedure
E N D
Chapter 9 Hypothesis Testing • Null and Alternative Hypotheses and Errors in Testing • Large Sample Tests about a Mean: Rejection Points • Small Sample Tests about a Population Mean • Hypothesis Tests about a Population Proportion Dr. C. Lightner
Introduction • A Hypothesis Testis a statistical procedure that involves formulating a hypothesis and using sample data to decide on the validity of the hypothesis. • In this chapter we will focus on hypothesis tests about population means and proportions (since we are knowledgeable about how sample means and proportions are distributed). Dr. C. Lightner
Components of Hypothesis Tests • In order to test any hypothesis (even non statistical hypotheses) you need three elements: 1. The Hypotheses (Both the hypothesis that you are testing and the alternative hypothesis, which is the opposite of the hypothesis) 2. An unbiased test statistic- A measure that you will use to evaluate the hypotheses. 3. A rejection rule- the rule that you will use to ultimately decide if a hypothesis should be rejected. Dr. C. Lightner
Non Statistical Examples • Example 1: • Hypothesis: I should be admitted to Harvard Law School Alternative Hypothesis: I should not be admitted to Harvard Law School • Test Statistic: LSAT • Rejection Rule: Harvard may have a cut off LSAT score for admitting students. • Example 2: • Hypothesis: OJ is innocent Alternative Hypothesis: OJ is guilty • Test Statistic: A jury of 12 of his peers. • Rejection Rule: If 12 of 12 jurors rule that he is guilty beyond a reasonable doubt. Dr. C. Lightner
Hypothesis Testing Rules • In order to test a hypothesis, you must first find the test statistic and rejection rule that is appropriate for evaluating your hypotheses (i.e., we could not evaluate OJ’s innocence based upon his LSAT score). • All hypothesis tests will always end in 1 of 2 ways: 1. You conclude that you must reject the null hypothesis (This is the same as concluding that you have proven the alternative true); or 2. You conclude that you do not have enough evidence to reject the null hypothesis (This is the same as concluding that you do not have enough evidence to prove that the alternative is true). Dr. C. Lightner
Developing Null and Alternative Hypotheses • Hypothesis testing can be used to determine whether a statement about the value of a population parameter should or should not be rejected. • The null hypothesis, denoted H0, is a statement of the basic proposition being tested. The statement is not rejected unless there is convincing sample evidence that it is false. • Thealternativeorresearch hypothesis, denoted Ha, is an alternative (to the null hypothesis) statement that will be accepted only if there is convincing sample evidence that it is true. Dr. C. Lightner
Developing Null and Alternative Hypotheses • Testing the Validity of a Claim • If you wish to find evidence to contradict a claim, the claim should be stated as the null hypothesis. • If you wish to prove a claim to be true, then you should state the claim as the alternative hypothesis. • Claims that test whether the mean is equal to a specific value must be stated as the null hypothesis. Anderson, Sweeney, and Williams
A Summary of Forms for Null and Alternative Hypotheses about a Population Mean • The equality part of the hypotheses always appears in the null hypothesis. • In general, a hypothesis test about the value of a population mean must take one of the following three forms (Lower Tail) (Upper Tail) • Where 0 is a specific value H0: >0 Ha: < 0 H0: <0 Ha: > 0 H0: = 0 Ha: 0 One-tailed One-tailed Two-tailed Dr. C. Lightner
Example 9.1: Metro EMS A major west coast city provides one of the most comprehensive emergency medical services in the world. Operating in a multiple hospital system with approximately 20 mobile medical units, the service goal is to respond to medical emergencies with a mean time of 12 minutes or less. The director of medical services wants to formulate a hypothesis test that could use a sample of emergency response times to determine whether there is sufficient evidence to prove that they are not meeting their goal. Anderson, Sweeney, and Williams
Example 9.1: Metro EMS cont. • Null and Alternative Hypotheses HypothesesConclusion and Action H0: < The emergency service is meeting the response goal; no appropriate follow-up action is necessary. Ha:> The emergency service is not meeting the response goal; appropriate follow-up action is necessary. Where: = mean response time for the population of medical emergency requests. By defining the claim as the null hypothesis we can set out to try to find sufficient evidence to reject the claim. Anderson, Sweeney, and Williams
Example 9.2: The Potato Chip Manufacturer Many people eat chips with their soda. Suppose a potato chip manufacturer is concerned that the bagging equipment may not be functioning properly when filling 10-oz bags. You have been asked to set up a hypothesis test that will help determine if there is a problem with the bagging equipment. What null and alternative hypothesis would you use? Pelosi and Sandifer
Example 9.2: The Potato Chip Manufacturer cont. HypothesesConclusion and Action H0: =0 The machine is working properly; no appropriate follow-up action is necessary. Ha:0 The machine is not working properly; appropriate follow-up action is necessary. Where: = mean filling weight for the machine. Dr. C. Lightner
Type I Errors • Since hypothesis tests are based on sample data, we must allow for the possibility of errors. • A Type I error is rejecting H0 when it is true. • The person conducting the hypothesis test specifies the maximum allowable probability of making a Type I error, denoted by and called the level of significance. Dr. C. Lightner
Type I and Type II Errors • A Type II error is accepting H0 when it is false. • Generally, we cannot control for the probability of making a Type II error, denoted by . • Statistician avoids the risk of making a Type II error by using the phrase “do not reject H0” instead of “accept H0”. Anderson, Sweeney, and Williams
Type I and Type II Errors Population Condition H0 True (m< 12) H0 False (m > 12) Conclusion AcceptH0 (Concludem< 12) Correct Decision Type II Error Type I Error Correct Decision RejectH0 (Conclude m > 12) Anderson, Sweeney, and Williams
Large Sample Tests about Mean (n30) and knownORSmall Sample Tests about Mean, Normal pop. and known Hypotheses: H0: >0 Ha: < 0 Test Statistic: Rejection Rule Reject H0 if z<- z or Reject H0 if p-value<a Lower Tail test Hypotheses: H0: <0 Ha: > 0 Test Statistic: Rejection Rule Reject H0 if z>z or Reject H0 if p-value<a Upper Tail test Hypotheses: H0: = 0 Ha: 0 Test Statistic: Rejection Rule Reject H0 if |z| >| z | or Reject H0 if p-value<a Two Tailed test Dr. C. Lightner
Steps for Computing z (The critical value) z value for an upper tail area of 1. In order to determine the z value with an upper tail area of , we need the area beneath the normal curve to the left of the z value of interest. Compute this area= 1- . area= 1- za 2. Go to the area section of the standard normal table and find the area closest to the area computed in 1. The corresponding z value is z. ***To find the z value for a lower tail area of , look up (or closest value) directly on chart and the corresponding z value is z. Dr. C. Lightner
Steps for Computing z/2 (The critical value for a 2 tailed test) 1. Compute /2. • In order to determine the z value with an upper tail area of /2, we need the area beneath the normal curve to the left of the z value of interest. Compute this area= 1- . area= 1- /2 /2 Za/2 3. Go to the area section of the standard normal table and find the area closest to the area computed in 2. The corresponding z value is z/2. Dr. C. Lightner
Understanding the Critical Value Approach (Upper tail area) One-Tailed Test about a Population Mean: Large n = P(Type I Error) Sampling distribution of sample mean (assuming H0 is true) Reject H0 Do Not Reject H0 Anderson, Sweeney, and Williams 0 z (Critical value)
Understanding the Critical Value Approach (Two tail area) Two-Tailed Test about a Population Mean: Large n = P(Type I Error) Sampling distribution of sample mean (assuming H0 is true) Reject H0 Reject H0 /2 /2 Anderson, Sweeney, and Williams z z/2 -z/2 0 (Critical values)
Steps of Hypothesis Testing • Determine the null and alternative hypotheses. 2. Specify the level of significance . 3. Select the test statistic that will be used to test the hypothesis. • State the rejection rule for H0 . **If using the critical value approach, use to determine the critical value. (Find the rejection rule that is appropriate for your null hypothesis) • Collect the sample data and compute the value of the test statistic. **If using the p-value approach, find the p-value using the test statistic. • Use the value of the test statistic and the rejection rule to determine whether to reject H0. 7. State the conclusion in layman’s terms. Dr. C. Lightner
Example 9.1 (Revisited using Critical Value Approach) Recall example 9.1. Suppose we collected a sample of n = 40 EMS calls and computed = 13.25 minutes and σ = 3.2 minutes. Using =.05 conduct a hypothesis test to see if you can find the evidence to refute their claim that the average response time is less than 12 minutes. (The sample standard deviation s can be used to estimate the population standard deviation .) Step 1: H0: <12 (The emergency service is meeting the response goal; no appropriate follow-up action is necessary. ) Ha: >12 (The emergency service is not meeting the response goal; appropriate follow-up action is necessary. - mean filling weight for the machine. Step 2: =.05 Step 3: Dr. C. Lightner
Example 9.1 cont. Step 4: Reject H0 if z> zα = 1.645 (α=0.05) Step 5: Step 6: Is z> 1.645? Since 2.47 > 1.645, we reject H0 in favor of Ha. Step 7: Conclusion:We are 95% confident that Metro EMS is not meeting the response goal of 12 minutes; appropriate action should be taken to improve service. Dr. C. Lightner
Example 9.3 (Using the Critical Value Approach) Consider a company that is trying a new and cheaper package design for its product. The average sales for this product are currently $1500/month. Suppose they wish to prove that sales will decrease as a result of the new method. In order to test this claim they used n=36 test stores and computed an average sale, = $1450 with σ = $250. (Use =.10) Step 1: H0: >$1500 (The average sales for the product with the new and cheaper package design will be at least $1500. So, the new and cheaper packaging is increasing sales.) Ha: <$1500 (The average sales for the product with the new and cheaper package design will exceed $1500. So, the cheaper packaging is decreasing sales) m- The average monthly sales for the product with the new and cheaper packaging design Step 2: =.1 Step 3: Dr. C. Lightner
Example 9.3 cont. Step 4: Reject H0 if z<- zα = -1.28 (α=0.10) Step 5: Step 6: Is z<-1.28? Since -1.2 is not less than -1.28, we cannot reject H0. Step 7:Thus, we cannot find sufficient evidence to prove that the new advertising method will decrease sales Dr. C. Lightner
Example 9.4: The Chapperel Steel Company Another recent management approach is to have employees become actual partners of the business. Chapperel Steel Company has done exactly this and the company feels that one of the benefits of this concept is that the average number of sick days will decrease. Prior to implementing this program, Chapperel had an average of 7.2 sick days per employee. Set up the null and alternative hypothesis to test if the average number of sick days per employee is different from 7.2. After implementing this program, a sample of 40 employees provides a sample mean of 6.5 day and a population standard deviation of 2.5 days. Test this hypothesis test using =.01. Pelosi and Sandifer Dr. C. Lightner
Example 9.4 ( Using Critical Value Approach) Step 1:H0: 7.2(The average number of sick days per employee is 7.2. So, the program DOES NOT alter the number of sick days.) Ha: 7.2(The average number of sick days per employee is different from 7.2. So, the program DOES alter the number of sick days.) m- The average number of sick days after implementing the program Step 2:=.01 Step 3: Dr. C. Lightner
Example 9.4 Cont. Step 4: Reject H0 if |z| > |zα/2 | =2.575 (=.01) Step 5: Step 6: Is |z| > |2.575| ? No. Since |-1.77|= 1.77 does not exceed 2.575, we cannot reject this claim. Step 7:Thus, we can not prove the claim that this program does alter the number of employee sick days. Dr. C. Lightner
Example 9.5 Glow Toothpaste(Using the Critical Value Approach) The production line for Glow toothpaste is designed to fill tubes of toothpaste with a mean weight of 6 ounces. Periodically, a sample of 30 tubes will be selected in order to check the filling process. Quality assurance procedures call for the continuation of the filling process if the sample results are consistent with the assumption that the mean filling weight for the population of toothpaste tubes is 6 ounces; otherwise the filling process will be stopped and adjusted. Let the sample mean equal 6.1 and the population standard deviation equal 0.2 ounces. Anderson, Sweeney, and Williams Dr. C. Lightner
Example 9.5 cont. Step 1: H0: Ha: Step 2:Assume a .05 level of significance. • Step 3: • Step 4: Assuming a .05 level of significance, • A.) Using critical value approach Reject H0 if |z| > zα/2 =1.96 (=.05) B.) Using p-value approach Reject H0 if p-value <a Dr. C. Lightner
Step 5: Assume that a sample of 30 toothpaste tubes provides a sample mean of 6.1 ounces and population standard deviation of 0.2 ounces. Let n = 30, = 6.1 ounces, =0.2 ounces • p-value= 2*(0.0031)=0.0062 Step 6: A.) Using critical value approach Is |z| > 1.96 ? Since 2.74 > 1.96, we reject H0 in favor of Ha. B.) Using p-value approach, Is 0.0062 <0.5? Since 0.0062 <0.5, we reject H0 in favor of Ha. Step 7:Thus, the mean filling weight for the population of toothpaste tubes is not 6 ounces. Dr. C. Lightner
Confidence Interval Approach to aTwo-Tailed Test about a Population Mean • Select a simple random sample from the population and use the value of the sample mean to develop the confidence interval for the population mean . • If the confidence interval contains the hypothesized value 0, do not reject H0. Otherwise, reject H0. Anderson, Sweeney, and Williams Dr. C. Lightner
Example 9.5 -Revisited (Confidence Interval Approach) • Confidence Interval Approach to a Two-Tailed Hypothesis Test The 95% confidence interval for is or 6.0284 to 6.1716 Since the hypothesized value for the population mean, 0 = 6, is not in this interval, the hypothesis-testing conclusion is that the null hypothesis, H0: = 6, can be rejected. (As shown in the previous slide, following traditional hypothesis testing steps.) Dr. C. Lightner
Large Sample Tests about Mean (n30) and unknownOR Small Sample Tests about Mean, Normal pop. and unknown Hypotheses: H0: > 0 Ha: < 0 Test Statistic: Rejection Rule Reject H0 if t<- t or Reject H0 if p-value<a Lower-Tail test Hypotheses: H0: < 0 Ha: > 0 Test Statistic: Rejection Rule Reject H0 if t> t or Reject H0 if p-value<a Upper-Tail test Hypotheses: H0: = 0 Ha: 0 Test Statistic: Rejection Rule Reject H0 if |t| >| t | or Reject H0 if p-value<a Two-Tailed test Dr. C. Lightner
Steps for Computing t(Using the Critical Value Approach) Computing t upper (lower) tail area of . • Compute the upper (lower) tail area. • =1 – (Confidence Coefficient). • **Sometimes is given, in this case we do not have to compute anything. We can just use what is given. 2. Compute the degrees of freedom= n-1. 3. Go to t chart and find the t value with the upper (lower) tail area (computed in step 1), and the degrees of freedom (computed in step 2). This is t . Dr. C. Lightner
Summary of Hypothesis Testing Procedures for a Population Mean Yes No n > 30 ? No Popul. approx. normal ? known ? Yes Yes Use s to estimate No known ? No Use s to estimate Yes Slide 16 Slide 34 Increase n to> 30 Slide 34 Slide 16 Anderson, Sweeney, and Williams Dr. C. Lightner
Example 9.6: Highway Patrol A State Highway Patrol periodically samples vehicle speeds at various locations on a particular roadway. The sample of vehicle speeds is used to test the hypothesis H0: m< 65. The locations where H0 is rejected are deemed the best locations for radar traps. At Location F, a sample of 16 vehicles shows a mean speed of 68.2 mph with a standard deviation of 3.8 mph. Use an a = .05 to test the hypothesis. Anderson, Sweeney, and Williams Dr. C. Lightner
Example 9.6 cont.(Using the critical value and p-value Approaches) Let n = 16, = 68.2 mph, s = 3.8 mph Step 1:H0: m< 65 Ha: m> 65 Step 2:a = .05 Step 3: Step 4: Assuming a .05 level of significance, • A.) Using critical value approach Reject H0 if t > tα =1.753 (=.05, df=15) B.) Using p-value approach Reject H0 if p-value <a Dr. C. Lightner
Step 5: Compute the value of our test statistic • = 68.2 – 65 = 3.36 3.8/4 • p-value<0.005 Step 6:A.) Using critical value approach Is 3.36>1.753? Yes. So, reject Ho in favor of Ha. B.) Using p-value approach Is p-value < 0.05? Yes. So, reject Ho in favor of Ha. . Step 7:Conclude that vehicle speeds in that area exceed 65. Dr. C. Lightner
A Summary of Forms for Null and Alternative Hypotheses about a Population Proportion • The equality part of the hypotheses always appears in the null hypothesis. • In general, a hypothesis test about the value of a population proportion pmust take one of the following three forms (where p0 is the hypothesized value of the population proportion). H0: p>p0H0: p<p0 Ha: p < p0Ha: p > p0 H0: p= p0 Ha: pp0 One-tailed One-tailed Two-tailed Dr. C. Lightner
Tests about a Population Proportion:Large-Sample Case {(np> 5) and n(1 - p) > 5)} Hypotheses: H0: p> p0 Ha: p<p0 Test Statistic: Rejection Rule Reject H0 if z<- z or Reject H0 if p-value<a Lower Tail test Hypotheses: H0: p<p0 Ha: p> p0 Test Statistic: Rejection Rule Reject H0 if z>z or Reject H0 if p-value<a Upper Tail test Hypotheses: H0: p = p0 Ha: p p0 Test Statistic: Rejection Rule Reject H0 if |z| >| z | or Reject H0 if p-value<a Two- Tailed test where Dr. C. Lightner
Example 9.7: NSC For a Christmas and New Year’s week, the National Safety Council estimated that 500 people would be killed and 25,000 injured on the nation’s roads. The NSC claimed that 50% of the accidents would be caused by drunk driving. A sample of 120 accidents showed that 67 were caused by drunk driving. Use these data to test the NSC’s claim with a = 0.05. Dr. C. Lightner
Example: NSC Step 1:H0: p = .5 Ha: p .5 Step 2:a = 0.05 Step 3: Step 4:A.) Using critical value approach Reject H0 if |z| > zα/2 =1.96 (α=.05) B.) Using the p-value approach Reject H0 if p-value<a Dr. C. Lightner
Step 5: p-value=2*?? Step 6: Is |z| > 1.96 ? No, so do not reject H0. What about the p-value approach? Step 7: Thus, we do not have enough evidence to reject the claim that 50% of the accidents would be caused by drunk driving. Dr. C. Lightner
Understanding the p-value • A p-value is a probability that is computed using the value of the test statistic. • For a lower tail test, a p-value is the probability of obtaining a value for the test statistic as small as or smaller than that provided by the sample. • For an upper tail test, a p-value is the probability of obtaining a value for the test statistic as large as or larger than that provided by the sample. • The p-value is used to determine whether Ho should be rejected. • Smaller p-values indicate more evidence against the null hypothesis (Ho) • Reject H0 if the p-value <a . Dr. C. Lightner
Sampling distribution of Lower-Tailed Test About a Population Mean: s Known p-Value <a, so reject H0. p-value approach a = .10 p-value 72 z Anderson, Sweeney, and Williams z = -1.46 -za = -1.28 0
Sampling distribution of Upper-Tailed Test About a Population Mean: s Known • p-value approach p-Value <a, so reject H0. a = .04 p-value 11 z za = 1.75 z = 2.29 0
Example 9.1 (Revisited using p-value approach) Step 1: H0: <12 Ha: >12 Step 2: =.05 Step 3: Step 6: Is p-value<0.05? Since 0.0068< 0.05 we have enough evidence to reject the null hypothesis (Ho) in favor of the alternative hypothesis (Ha). Step 7: Conclusion:We are 95% confident that Metro EMS is not meeting the response goal of 12 minutes; appropriate action should be taken to improve service. Step 4: Reject H0 if p-value<a. **Whether we use the p-value or the critical value approach, we ALWAYS will come to the SAME conclusion Step 5: p-value= 0.0068 Dr. C. Lightner
Example 9.3 (Revisited using p-value approach) Step 6: Is p-value<0.1? Since 0.1151 is not less than 0.1, we cannot reject H0. Step 7:Thus, we cannot find sufficient evidence to prove that the new advertising method will decrease sales. ** This is the same conclusion reached using the critical value approach Step 1: H0: >$1500 Ha: <$1500 Step 2: =.1 Step 3: Step 4: Reject H0 if p-value <a (α=0.10) Step 5: p-value=0.1151 Dr. C. Lightner
Example 9.4 (Revisited using p-value approach) Step 6: Is p-value<0.01? Since 0.0768 is not less than 0.01, we cannot reject H0. Step 7:Thus, we can’t refute the claim that this program does alter the number of employee sick days. ** This is the same conclusion reached using the critical value approach Step 1:H0: 7.2 Ha: 7.2 Step 2: =.01 Step 3: Step 4: Reject H0 if p-value <a (α=0.01) Step 5: p-value=(2)*0.0384= 0.0768 Dr. C. Lightner