Report

7 Hypothesis Testing Useful videos/websites: Video on writing hypothesis statements: http://screencast.com/t/ZO8kMt6v Overview Video on hypothesis testing: http://screencast.com/t/qdz8F0yp Difference between Type I and II Errors: http://screencast.com/t/fhWKC3ypM8 Section 7.1 Introduction to Hypothesis Testing Definition A hypothesis is a statement or claim regarding a characteristic of one or more populations. What do you mean by “claim”? What do you mean by “claim”? Let’s measure the raisins in each box with a random variable, x. H0: mu = 2 scoops H1: mu not = 2 scoops Which one is the claim? Null hypothesis H0 contains a statement of equality such as , = or . Alternative hypothesis Ha or H1 contains a statement of inequality such as < , or > For example: H0: Mr. Smith is innocent of the crime. H1: Mr. Smith is guilty of the crime. ` Writing Hypotheses Write the claim about the population. Then, write its complement. Note: Either hypothesis, the null or the alternative, can represent the claim. Writing Hypotheses Write the claim about the population. Then, write its complement. Either hypothesis, the null or the alternative, can represent the claim. A hospital claims its ambulance response time is less than 10 minutes. claim A consumer magazine claims the proportion of cell phone calls made during evenings and weekends is at most 60%. claim Four Outcomes Correct Type II Error Type I Error Correct H0: Mr. Smith is innocent of the crime. H1: Mr. Smith is guilty of the crime. Hypothesis Testing Errors • Type I error: Reject a true Null hypothesis (i.e. innocent person found guilty) α = alpha = probability of Type I error • Type II error: Do not reject a false Null hypothesis (i.e. guilty man goes free) β = beta = probability of Type II error Two-tailed vs. One-tailed tests Ho: parameter = some value 1. two-tailed test: Equal versus not equal hypothesis H1: parameter some value 2. left-tailed test: Equal versus less than 3. right-tailed test: Equal versus greater than Ho: parameter = some value (or greater) H1: parameter some value Ho: parameter = some value (or less) H1: parameter some value Types of Hypothesis Tests Ha is more probable Ha is more probable Ha is more probable Right-tail test Left-tail test Two-tail test One-tailed or two? 1. A university publicizes that the proportion of its students who graduate in 4 years is 82%. Solution: H0: p = 0.82 Ha: p ≠ 0.82 Two-tailed test ½ P-value area -z ½ P-value area 0 z z 14 One-tailed or two? 2. A water faucet manufacturer announces that the mean flow rate of a certain type of faucet is less than 2.5 gallons per minute. Solution: H0: μ ≥ 2.5 gpm Ha: μ < 2.5 gpm Left-tailed test P-value area -z 0 z One-tailed or two? 3. A cereal company advertises that the mean weight of the contents of its 20-ounce size cereal boxes is more than 20 ounces. Solution: H0: μ ≤ 20 oz Ha: μ > 20 oz Right-tailed test P-value ar ea 0 z z Hypothesis Test Strategy 1. Begin by assuming the equality condition in the null hypothesis is true. This is regardless of whether the claim is represented by the null hypothesis or by the alternative hypothesis. 2. Collect data from a random sample taken from the population and calculate the necessary sample statistics. 3. If the sample statistic has a low probability of being drawn from a population in which the null hypothesis is true, you will reject H0. (As a consequence, you will support the alternative hypothesis.) 4. If the probability is not low enough, fail to reject H0. Two Methods: P-value Method – uses the probability of obtaining a sample statistics with a value as extreme (or more) than the one determined by sample data. Critical Value Method – define a ‘rejection region’ using a critical value (similar to the critical z). P-values P-value (or probability value) The probability, if the null hypothesis is true, of obtaining a sample statistic with a value as extreme or more extreme than the one determined from the sample data. Depends on the nature of the test. 19 Larson/Farber 4th ed. P-values The P-value is the probability of obtaining a sample statistic with a value as extreme or more extreme than the one determined by the sample data. P-value = indicated area Area in left tail Area in right tail z z For a right tail test For a left tail test If z is negative, twice the area in the left tail If z is positive, twice the area in the right tail z z For a two-tail test Finding P-values: 1-tail Test The test statistic for a right-tail test is z = 1.56. Find the P-value. Area in right tail z = 1.56 Answer: The area to the right of z = 1.56 is 1 – .9406 = 0.0594. The P-value is 0.0594. Finding P-values: 2-tail Test The test statistic for a two-tail test is z = –2.63. Find the corresponding P-value. z = –2.63 Answer: The area to the left of z = –2.63 is 0.0043. The P-value is 2(0.0043) = 0.0086. P-value Method In Words In Symbols 1. State the claim mathematically and verbally. Identify the null and alternative hypotheses. State H0 and Ha. 2. Specify the level of significance. Identify . 3. Determine the standardized test statistic. z 4. Find the area that corresponds to z. Use Table 4 in Appendix B. x n 23 P-value Method – Part II In Words In Symbols 5. Find the P-value. a. For a left-tailed test, P = (Area in left tail). b. For a right-tailed test, P = (Area in right tail). c. For a two-tailed test, P = 2(Area in tail of test statistic). Reject H0 if P-value 6. Make a decision to reject or is less than or equal fail to reject the null hypothesis. to . Otherwise, fai l to reject H0. 7. Interpret the decision in the context of the original claim. 24 1. Identify Hypothesis and indicate which one is the claim. H0 : Ha : 2. Identify level of significance = 3. Compute the test statistic. [Depends on what parameter is being tested.] z x n 4. Find the area corresponding to z. Use preferred method for finding area in tail. 5. Find the P-value a. b. 6. Make a Decision Reject H0 if p-value <= , otherwise fail to reject. 7. Interpret the decision in the context of the original claim. For a one-tailed test, P = (Area in left tail). For a two-tailed test, P = 2(Area in tail). Example: Hypothesis Testing Using P-values You think that the average franchise investment information shown in the graph is incorrect, so you randomly select 30 franchises and determine the necessary investment for each. The sample mean investment is $135,000 with a standard deviation of $30,000. Is there enough evidence to support your claim at = 0.05? Use the P-value method. 26 1. Identify Hypothesis and indicate which one is the claim. 2. Identify level of significance 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z. 5. Find the P-value 6. Make a Decision 7. Interpret the decision in the context of the original claim. H0 is claim = 0.05 x $135,000 z x n Solution: Hypothesis Testing Using P-values z x • P-value n 135, 000 143, 260 30, 000 1.51 30 -1.51 0 z 1. Identify Hypothesis and indicate which one is the claim. 2. Identify level of significance 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z. 5. Find the P-value 6. Make a Decision 7. Interpret the decision in the context of the original claim. H0 is claim = 0.05 x 135,000 143, 260 z 1.51 n 30,000 30 Solution: Hypothesis Testing Using P-values z x n 135, 000 143, 260 30, 000 1.51 30 • P-value P = 2(0.0655) = 0.1310 0.0655 -1.51 0 z 30 1. Identify Hypothesis and indicate which one is the claim. 2. Identify level of significance 3. Compute the test statistic. [Depends on what parameter is being tested.] H0 is claim = 0.05 x 135,000 143, 260 z 1.51 n 30,000 30 4. Find the area corresponding to z. Area to the left of -1.51 is equal to 0.0655 5. Find the P-value P = 2(.0655) because this is a two-tailed test. P = .1310 6. Make a Decision Since .1310 > , we fail to reject H0. 7. Interpret the decision in the context of the original claim. Since the claim was that the average (mu) was equal to $143,260, we say “there is not enough evidence to reject the claim”. Example: Testing with P-values Employees in a large accounting firm claim that the mean salary of the firm’s accountants is less than that of its competitor’s, which is $45,000. A random sample of 30 of the firm’s accountants has a mean salary of $43,500 with a standard deviation of $5200. At α = 0.05, test the employees’ claim. 32 1. H0: Mu = $45,000 (or more) H1: Mu < $45,000 (left-tailed test) 2. Alpha = .05 3. Xbar = $43,500, Sx = $5200 (Since n >= 30, we can use a z-statistic) 4. Compute z-statistic (See pg 387) z = -1.58 5. Find the P-value: P(z <= -1.58) = .0571 6. Since the P-value of .0571 is NOT less than or equal to alpha (.05), we DO NOT REJECT H0 7. There is not sufficient evidence to support the claim that the mean salary Test Decisions with P-values The decision about whether there is enough evidence to reject the null hypothesis can be made by comparing the P-value to the value of the level of significance of the test. If If , reject the null hypothesis. fail to reject the null hypothesis. Interpreting the Decision Claim Decision Claim is H0 Reject H0 Fail to reject H0 Claim is Ha There is enough evidence to reject the claim. There is enough evidence to support the claim. There is not enough evidence to reject the claim. There is not enough evidence to support the claim. Critical Value method In Words In Symbols 1. State the claim mathematically and verbally. Identify the null and alternative hypotheses. 2. Specify the level of significance. 3. Find the standardized test statistic 4. Determine the critical value(s) & rejection region(s). z x n or if n 30 use s. Use Table 4 in Appendix B. 37 Critical Value Z method – Part II In Words 5. Make a decision to reject or fail to reject the null hypothesis. In Symbols If z is in the rejection region, reject H0. Otherwise, fail to reject H0. 6. Interpret the decision in the context of the original claim. Larson/Farber 4th ed. 38 Rejection Regions and Critical Values Rejection region (or critical region) The range of values for which the null hypothesis is not probable. If a test statistic falls in this region, the null hypothesis is rejected. A critical value z0 separates the rejection region from the nonrejection region. 39 Rejection Regions and Critical Values Finding Critical Values in a Normal Distribution 1. Specify the level of significance . 2. Decide whether the test is left-, right-, or two-tailed. 3. Find the critical value(s) z0. If the hypothesis test is a. left-tailed, find the z-score that corresponds to an area o f , b. right-tailed, find the z-score that corresponds to an area of 1 – , c. two-tailed, find the z-score that corresponds to ½ and 1 – ½. 4. Sketch the standard normal distribution. Draw a vertical li ne at each critical value and shade the rejection region(s). 40 Example: Finding Critical Values Find the critical value and rejection region for a two-tailed test with = 0.05. Solution: 1 – α = 0.95 ½α = 0.025 z0 -z0 = -1.96 ½α = 0.025 0 z0 =z01.96 z The rejection regions are to the left of -z0 = -1.96 and to the right of z0 = 1.96. 41 Decision Rule Based on Rejection Region To use a rejection region to conduct a hypothesis test, calculate the standardized test statistic, z. If the standardized test statistic 1. is in the rejection region, then reject H0. 2. is not in the rejection region, then fail to reject H0. Fail to reject Ho. Fail to reject H0. Reject H0. z < z0 z Reject Ho. 0 0 Left-Tailed Test z Fail to reject H 0 0 Reject H0 z0 z > zz0 Right-Tailed Test Reject H0 z0 z0 z < -zTwo-Tailed 0 Test 0 z >zz0 42 Example: Testing with Critical Value Employees in a large accounting firm claim that the mean salary of the firm’s accountants is less than that of its competitor’s, which is $45,000. A random sample of 30 of the firm’s accountants has a mean salary of $43,500 with a standard deviation of $5200. At α = 0.05, test the employees’ claim. 43 Example – Critical Z • • • • • Test Statistic x 43,500 45, 000 z n 5200 30 H0: μ ≥ $45,000 Ha: μ < $45,000 = 0.05 Rejection Region: 0.05 0 -1.58 z 1.58 • Decision: Fail to reject H0 At the 5% level of significance, there is not sufficient evidence to support the employees’ claim that the mean salary is less than $45,000. Zc=-1.645 44 Section 7.2 Hypothesis Testing for the Mean Large Samples (n 30) The z-Test for a Mean The z-test is a statistical test for a population mean. The z-test can be used: (1) if the population is normal and s is known or (2) when the sample size, n, is at least 30. The test statistic is the sample mean and the standardized test statistic is z. When n 30, use s in place of . The z-Test for a Mean (P-value) A cereal company claims the mean sodium content in one serving of its cereal is no more than 230 mg. You work for a national health service and are asked to test this claim. You find that a random sample of 52 servings has a mean sodium content of 232 mg and a standard deviation of 10 mg. At = 0.05, do you have enough evidence to reject the company’s claim? 1. Write the null and alternative hypothesis. 2. State the level of significance. = 0.05 3. Determine the sampling distribution. Since the sample size is at least 30, the sampling distribution is normal. 4. Find the test statistic and standardize it. n = 52 s = 10 Test statistic 5. Calculate the P-value for the test statistic. Since this is a right-tail test, the P-value is the area found to the right of z = 1.44 in the normal distribution. From the table P = 1 – 0.9251 P = 0.0749. Area in right tail z = 1.44 6. Make your decision. Compare the P-value to . Since 0.0749 > 0.05, fail to reject H0. 7. Interpret your decision. There is not enough evidence to reject the claim that the mean sodium content of one serving of its cereal is no more than 230 mg. The z-Test for a Mean (Critical Value) A cereal company claims the mean sodium content in one serving of its cereal is no more than 230 mg. You work for a national health service and are asked to test this claim. You find that a random sample of 52 servings has a mean sodium content of 232 mg and a standard deviation of 10 mg. At = 0.05, do you have enough evidence to reject the company’s claim? 1. Write the null and alternative hypothesis. 2. State the level of significance. = 0.05 3. Determine the sampling distribution. Since the sample size is at least 30, the sampling distribution is normal. Since Ha contains the > symbol, this is a right-tail test. Rejection region z0 1.645 4. Find the critical value. 5. Find the rejection region. 6. Find the test statistic and standardize it. n = 52 = 232 s = 10 7. Make your decision. z = 1.44 does not fall in the rejection region, so fail to reject H 0 8. Interpret your decision. There is not enough evidence to reject the company’s claim that there is at most 230 mg of sodium in one serving of its cereal. Using the P-value of a Test to Compare Areas = 0.05 z0 = –1.645 Rejection area 0.05 z0 z = –1.23 P = 0.1093 z For a P-value decision, compare areas. If reject H0. If fail to reject H0. For a critical value decision, decide if z is in the rejection region If z is in the rejection region, reject H0. If z is not in the rejection region, fail to reject H0. Section 7.3 Hypothesis Testing for the Mean Small Samples (n < 30) The t Sampling Distribution Find the critical value t0 for a left-tailed test given and n = 18. = 0.01 d.f. = 18 – 1 = 17 t0 = –2.567 Area in left tail t0 Find the critical values –t0 and t0 for a two-tailed test given = 0.05 and n = 11. –t0 = –2.228 and t0 = 2.228 d.f. = 11 – 1 = 10 t0 t0 Testing –Small Sample A university says the mean number of classroom hours per week for full-time faculty is 11.0. A random sample of the number of classroom hours for full-time faculty for one week is listed below. You work for a student organization and are asked to test this claim. At = 0.01, do you have enough evidence to reject the university’s claim? 11.8 8.6 12.6 7.9 6.4 10.4 13.6 9.1 1. Write the null and alternative hypothesis 2. State the level of significance = 0.01 3. Determine the sampling distribution Since the sample size is 8, the sampling distribution is a t-distribution with 8 – 1 = 7 d.f. Since Ha contains the ≠ symbol, this is a two-tail test. 4. Find the critical values. 5. Find the rejection region. –t0 –3.499 t0 3.499 6. Find the test statistic and standardize it n=8 = 10.050 s = 2.485 7. Make your decision. t = –1.08 does not fall in the rejection region, so fail to reject H0 at 8. Interpret your decision. There is not enough evidence to reject the university’s claim that faculty spend a mean of 11 classroom hours. = 0.01 Section 7.4 Hypothesis Testing for Proportions Test for Proportions p is the population proportion of successes. The test statistic is . (the proportion of sample successes) If and the sampling distribution for The standardized test statistic is: is normal. Test for Proportions - Example A communications industry spokesperson claims that over 40% of Americans either own a cellular phone or have a family member who does. In a random survey of 1036 Americans, 456 said they or a family member owned a cellular phone. Test the spokesperson’s claim at = 0.05. What can you conclude? 1. Write the null and alternative hypothesis. 2. State the level of significance. = 0.05 3. Determine the sampling distribution. 1036(.40) > 5 and 1036(.60) > 5. The sampling distribution is normal. Rejection region 4. Find the critical value. 5. Find the rejection region. 1.645 6. Find the test statistic and standardize it. n = 1036 x = 456 7. Make your decision. z = 2.63 falls in the rejection region, so reject H0 8. Interpret your decision. There is enough evidence to support the claim that over 40% of Americans own a cell phone or have a family member who does. 1. State the null and alternative hypotheses. A company claims the mean lifetime of its AA batteries is more than 16 hours. A. H0: μ > 16 Ha: μ ≤ 16 B. H0: μ < 16 Ha: μ ≥ 16 C. H0: μ ≤ 16 Ha: μ > 16 D. H0: μ ≥ 16 Ha: μ < 16 Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 62 2. State the null and alternative hypotheses. A student claims the mean cost of a textbook is at least $125. A. H0: μ > 125 Ha: μ ≤ 125 B. H0: μ < 125 Ha: μ ≥ 125 C. H0: μ ≤ 125 Ha: μ > 125 D. H0: μ ≥ 125 Ha: μ < 125 Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 63 3. You are testing the claim that the mean cost of a new car is more than $25,200. How should you interpret a decision that rejects the null hypothesis? A. There is enough evidence to reject the claim. B. There is enough evidence to support the claim. C. There is not enough evidence to reject the claim. D. There is not enough evidence to support the claim. Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 64 True or false: Given H0: μ = 40 Ha: μ ≠ 40 and P = 0.0436. You would reject the null hypothesis at the 0.05 level of significance. A. True B. False Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 65 Answers Answers: 1. (C) 2. (D) 3. (B) 4. (A)