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
Chapter Nine Hypothesis Testing Understanding Basic Statistics Fourth Edition By Brase and Brase Prepared by: Lynn Smith Gloucester County College Hypothesis testing is used to make decisions concerning the value of a parameter. Copyright © Houghton Mifflin Company. All rights reserved. 9|2 Null Hypothesis: H0 • a working hypothesis about the population parameter in question Copyright © Houghton Mifflin Company. All rights reserved. 9|3 The value specified in the null hypothesis is often: • a historical value • a claim • a production specification Copyright © Houghton Mifflin Company. All rights reserved. 9|4 Alternate Hypothesis: H1 • any hypothesis that differs from the null hypothesis Copyright © Houghton Mifflin Company. All rights reserved. 9|5 An alternate hypothesis is constructed in such a way that it is the one to be accepted when the null hypothesis must be rejected. Copyright © Houghton Mifflin Company. All rights reserved. 9|6 A manufacturer claims that their light bulbs burn for an average of 1000 hours. We have reason to believe that the bulbs do not last that long. Determine the null and alternate hypotheses. Copyright © Houghton Mifflin Company. All rights reserved. 9|7 A manufacturer claims that their light bulbs burn for an average of 1000 hours. ... • The null hypothesis (the claim) is that the true average life is 1000 hours. • H0: m = 1000 Copyright © Houghton Mifflin Company. All rights reserved. 9|8 … A manufacturer claims that their light bulbs burn for an average of 1000 hours. We have reason to believe that the bulbs do not last that long. ... If we reject the manufacturer’s claim, we must accept the alternate hypothesis that the light bulbs do not last as long as 1000 hours. H1: m < 1000 Copyright © Houghton Mifflin Company. All rights reserved. 9|9 Types of Statistical Tests • Left-tailed: H1 states that the parameter is less than the value claimed in H0. • Right-tailed: H1 states that the parameter is greater than the value claimed in H0. • Two-tailed: H1 states that the parameter is different from ( ) the value claimed in H0. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 10 Given the Null Hypothesis H0: m = k If you believe that m is less than k, Use the left-tailed test: H 1: m < k Copyright © Houghton Mifflin Company. All rights reserved. 9 | 11 Given the Null Hypothesis H0: m = k If you believe that m is more than k, Use the right-tailed test: H 1: m > k Copyright © Houghton Mifflin Company. All rights reserved. 9 | 12 Given the Null Hypothesis H0: m = k If you believe that m is different from k, Use the two-tailed test: H 1: m k Copyright © Houghton Mifflin Company. All rights reserved. 9 | 13 General Procedure for Hypothesis Testing • Formulate the null and alternate hypotheses. • Take a simple random sample. • Compute a test statistic corresponding to the parameter in H0. • Assess the compatibility of the test statistic with H0. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 14 Hypothesis Testing about the Mean of a Normal Distribution with a Known Standard Deviation x-m test statistic z / n x mean of simple random sample m value stated in H 0 n sample size Copyright © Houghton Mifflin Company. All rights reserved. 9 | 15 P-value of a Statistical Test • Assuming H0 is true, the probability that the test statistic (computed from sample data) will take on values as extreme as or more than the observed test statistic is called the P-value of the test • The smaller the P-value computed from sample data, the stronger the evidence against H0. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 16 P-values for Testing a Mean Using the Standard Normal Distribution Use the standardiz ed sample test statistic x-m zx / n Copyright © Houghton Mifflin Company. All rights reserved. 9 | 17 P-value for a Left-tailed Test • P-value = probability of getting a test statistic less than z x Copyright © Houghton Mifflin Company. All rights reserved. 9 | 18 P-value for a Right-tailed Test • P-value = probability of getting a test statistic greater than z x Copyright © Houghton Mifflin Company. All rights reserved. 9 | 19 P-value for a Two-tailed Test • P-value = probability of getting a test statistic lower than z x or higher than z x Copyright © Houghton Mifflin Company. All rights reserved. 9 | 20 Types of Errors in Hypothesis Testing • Type I • Type II Copyright © Houghton Mifflin Company. All rights reserved. 9 | 21 Type I Error • rejecting a null hypothesis which is, in fact, true Copyright © Houghton Mifflin Company. All rights reserved. 9 | 22 Type II Error • not rejecting a null hypothesis which is, in fact, false Copyright © Houghton Mifflin Company. All rights reserved. 9 | 23 Type I and Type II Errors Copyright © Houghton Mifflin Company. All rights reserved. 9 | 24 Level of Significance, Alpha (a) • the probability of rejecting a true hypothesis • Alpha is the probability of a type I error Copyright © Houghton Mifflin Company. All rights reserved. 9 | 25 Type II Error • Beta = β = probability of a type II error (failing to reject a false hypothesis) • In hypothesis testing α and β values should be chosen as small as possible. • Usually α is chosen first. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 26 Power of the Test = 1 – β • The probability of rejecting H0 when it is in fact false = 1 – b. • The power of the test increases as the level of significance (a) increases. • Using a larger value of alpha increases the power of the test but also increases the probability of rejecting a true hypothesis. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 27 Probabilities Associated with a Statistical Test Copyright © Houghton Mifflin Company. All rights reserved. 9 | 28 Hypotheses and Types of Errors A fast food restaurant indicated that the average age of its job applicants is fifteen years. We suspect that the true age is lower than 15. We wish to test the claim with a level of significance of a = 0.01. Determine the Null and Alternate hypotheses and describe Type I and Type II errors. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 29 … average age of its job applicants is fifteen years. We suspect that the true age is lower than 15. H0: m = 15 H1: m < 15 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 30 H0: m = 15 H1: m < 15 a = 0.01 A type I error would occur if we rejected the claim that the mean age was 15, when in fact the mean age was 15 (or higher). The probability of committing such an error is as much as 1%. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 31 H0: m = 15 H1: m < 15 a = 0.01 A type II error would occur if we failed to reject the claim that the mean age was 15, when in fact the mean age was lower than 15. The probability of committing such an error is called beta. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 32 Concluding a Hypothesis Test Using the P-value and Level of Significance α • If P-value < α reject the null hypothesis and say that the data are statistically significant at the level α. • If P-value > α, do not reject the null hypothesis. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 33 Basic Components of a Statistical Test • Null hypothesis, alternate hypothesis and level of significance • Test statistic and sampling distribution • P-value • Test conclusion • Interpretation of the test results Copyright © Houghton Mifflin Company. All rights reserved. 9 | 34 Null Hypothesis, Alternate Hypothesis and Level of Significance • If the sample data evidence against H0 is strong enough, we reject H0 and adopt H1. • The level of significance, α, is the probability of rejecting H0 when it is in fact true. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 35 Test Statistic and Sampling Distribution • Mathematical tools to measure compatibility of sample data and the null hypothesis Copyright © Houghton Mifflin Company. All rights reserved. 9 | 36 P-value The probability of obtaining a test statistic from the sampling distribution that is as extreme as or more extreme than the sample test statistic computed from the data under the assumption that H0 is true Copyright © Houghton Mifflin Company. All rights reserved. 9 | 37 Test Conclusion • If P-value < α reject the null hypothesis and say that the data are statistically significant at the level α. • If P-value > α, do not reject the null hypothesis. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 38 Interpretation of Test Results • Give a simple explanation of conclusion in the context of the application. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 39 Reject or ... • When the sample evidence is not strong enough to justify rejection of the null hypothesis, we fail to reject the null hypothesis. • Use of the term “accept the null hypothesis” should be avoided. • When the null hypothesis cannot be rejected, a confidence interval is frequently used to give a range of possible values for the parameter. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 40 Fail to Reject H0 • There is not enough evidence to reject H0. The null hypothesis is retained but not proved. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 41 Reject H0 • There is enough evidence to reject H0. Choose the alternate hypothesis with the understanding that it has not been proven. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 42 Testing the Mean m When is Known • Let x be the appropriate random variable. Obtain a simple random sample (of size n) of x values and compute the sample mean x. • State the null and alternate hypotheses and set the level of significance α. • If x has a normal distribution, any sample size will work. If we cannot assume a normal distribution, use n > 30. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 43 Testing the Mean m When is Known • Use the test statistic: xm z n Copyright © Houghton Mifflin Company. All rights reserved. 9 | 44 Testing the Mean m When is Known • Use the standard normal distribution and the type of test (one-tailed or twotailed) to find the P-value corresponding to the test statistic. • If the P-value < α, then reject H0. If the P-value > α, then do not reject H0. • State your conclusion. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 45 Testing the Mean m When is Known: Example Your college claims that the mean age of its students is 28 years. You wish to check the validity of this statistic with a level of significance of a = 0.05. Assume the standard deviation is 4.3 years. A random sample of 49 students has a mean age of 26 years. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 46 Hypothesis Test Example H0: m = 28 H1: m 28 two Perform a ________-tailed test. Level of significance = α = 0.05 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 47 Sample Test Statistic xm z n where m mean specified in H 0 σ standard deviation of the x distributi on n sample size being used x sample test statistic Copyright © Houghton Mifflin Company. All rights reserved. 9 | 48 Sample Results x 26 , s 2.3. Calculate the test statistic z : xm 26 28 z 3.26 n 4.3 7 For a two-tailed test: P-value = 2P(z < 3.26) = 2(0.0006) = 0.0012 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 49 P-value and Conclusion • P-value = 0.0012 • α = 0.05. Since the P-value < α , we reject the null hypothesis. • We conclude that the true average age of students is not 28. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 50 Testing the Mean m When is Unknown • Let x be the appropriate random variable. Obtain a simple random sample (of size n) of x values and compute the sample mean x. • State the null and alternate hypotheses and set the level of significance α. • If x has a mound shaped symmetric distribution, any sample size will work. If we cannot assume this, use n > 30. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 51 Testing the Mean m When is Known • Use the test statistic: xm t with d.f. n - 1 s n where x, s and n are sample statistics. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 52 Testing the Mean m When is Unknown • Use the Student’s t distribution and the type of test (one-tailed or two-tailed) to find (or estimate) the P-value corresponding to the test statistic. • If the P-value < α, then reject H0. If the P-value > α, then do not reject H0. • State your conclusion. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 53 Using Table 4 to Estimate P-values Use one-tailed areas as endpoints of the interval containing the P-value for one-tailed tests. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 54 P-value for One-tailed Tests Copyright © Houghton Mifflin Company. All rights reserved. 9 | 55 Using Table 4 to Estimate P-values Use two-tailed areas as endpoints of the interval containing the P-value for one-tailed tests. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 56 P-value for Two-tailed Tests Copyright © Houghton Mifflin Company. All rights reserved. 9 | 57 Testing the Mean m When is Unknown: Example The Parks Department claims that the mean weight of fish in a lake is 2.1 kg. We believe that the true average weight is lower than 2.1 kg. Assume that the weights are mound-shaped and symmetric and a sample of five fish caught in the lake weighed an average of 1.99 kg with a standard deviation of 0.09 kg. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 58 Determine the P-value when testing the claim that the mean weight of fish caught in a lake is 2.1 kg (against the alternate that the weight is lower). A sample of five fish weighed an average of 1.99 kg with a standard deviation of 0.09 kg. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 59 Test the Claim Using α = 10% • Null Hypothesis: H0: m = 2.1 kg • Alternate Hypothesis: H1: m < 2.1 kg • α = 0.10 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 60 We will complete a left-tailed test with: x 1.99 s 0.09 n5 d.f . 4 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 61 The Test Statistic t x m 1.99 2.1 t 2.73 s .09 n 5 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 62 Using Table 4 with t = 2.73 and d.f. = 4 Sample t = 2.73 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 63 The t value is between two values in the chart.Therefore the P-value will be in a corresponding interval. Sample t = 2.73 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 64 Since we are performing a one-tailed test, we use the “one-tail area” line of the chart. Sample t = 2.73 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 65 Since we are performing a one-tailed test, we use the “one-tail area” line of the chart. Sample t = 2.73 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 66 0.025 < P-value < 0.050 … Sample t = 2.73 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 67 0.025 < P-value < 0.050 • Since the range of P-values is less than a (10%), we reject the null hypothesis. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 68 Interpret the results: • At level of significance 10% we rejected the null hypothesis that the mean weight of fish in the lake was 2.1 kg. • Based on our sample data, we conclude that the true mean weight is actually lower than 2.1 kg. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 69 Critical Region (Traditional) Method for Hypothesis Testing • An alternate technique to the P-value method • Logically equivalent to the P-value method Copyright © Houghton Mifflin Company. All rights reserved. 9 | 70 Critical Region Procedure for Testing m When is Known • Let x be the appropriate random variable. Obtain a simple random sample (of size n) of x values and compute the sample mean x. • State the null and alternate hypotheses and set the level of confidence α. • If x has a normal distribution, any sample size will work. If we cannot assume a normal distribution, use n > 30. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 71 Critical Region Method for Testing the Mean m When is Known • Use the test statistic: z x m n Copyright © Houghton Mifflin Company. All rights reserved. 9 | 72 Critical Region Method for Testing the Mean m When is Known • Using the level of significance α and the alternate hypothesis, show the critical region and critical values on a graph of the sampling distribution. • Conclude the test. If the test statistic is in the critical region, then reject H0. If not, do not reject H0. • State your conclusion. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 73 Most Common Levels of Significance • α = 0.05 and • α = 0.01 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 74 Critical Region(s) • The values of x for which we will reject the null hypothesis. • The critical values are the boundaries of the critical region(s). Copyright © Houghton Mifflin Company. All rights reserved. 9 | 75 Concluding Tests Using the Critical Region Method • Compare the sample test statistics to the critical value(s) • For a left-tailed test: • If the sample test statistic is < critical value, reject H0. • If the sample test statistic is > critical value, fail to reject H0. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 76 Critical Region for H0: m = k Left-tailed Test Copyright © Houghton Mifflin Company. All rights reserved. 9 | 77 Concluding Tests Using the Critical Region Method • • • • Compare the sample test statistics to the critical value(s) For a right-tailed test: If the sample test statistic is > critical value, reject H0. If the sample test statistic is < critical value, fail to reject H0. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 78 Critical Region for H0: m = k Right-tailed Test Copyright © Houghton Mifflin Company. All rights reserved. 9 | 79 Concluding Tests Using the Critical Region Method • Compare the sample test statistics to the critical value(s) • For a two-tailed test: • If the sample test statistic lies beyond the critical values, reject H0. • If the sample test statistic lies between the critical values, fail to reject H0. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 80 Critical Region for H0: m = k Two-tailed Test Copyright © Houghton Mifflin Company. All rights reserved. 9 | 81 Critical Values z0 for α = 0.05 and α = 0.01: Left-tailed Test Copyright © Houghton Mifflin Company. All rights reserved. 9 | 82 Critical Values z0 for α = 0.05 and α = 0.01: Right-tailed Test Copyright © Houghton Mifflin Company. All rights reserved. 9 | 83 Critical Values z0 for α = 0.05 and α = 0.01: Two-tailed Test Copyright © Houghton Mifflin Company. All rights reserved. 9 | 84 Testing the Mean m When is Known: Example Your college claims that the mean age of its students is 28 years. You wish to check the validity of this statistic with a level of significance of a = 0.05. Assume the standard deviation is 4.3 years. A random sample of 49 students has a mean age of 26 years. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 85 Hypothesis Test Example H0: m = 28 H1: m 28 two Perform a ________-tailed test. Level of significance = α = 0.05 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 86 Sample Test Statistic xm z n where m mean specified in H 0 σ standard deviation of the x distributi on n sample size being used x sample test statistic Copyright © Houghton Mifflin Company. All rights reserved. 9 | 87 Sample Results x 26 , s 2.3. Calculate the test statistic z : xm 26 28 z 3.26 n 4.3 7 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 88 Critical Region for a Two-tailed Test with α = 0.05 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 89 Our z = 3.26 falls within the critical region. z = 3.26 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 90 Since the test statistic is in the critical region we… • Reject the Null Hypothesis. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 91 Conclusion • We conclude that the true average age of students is not 28. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 92 Tests Involving a Proportion • We will test claims that a given percentage of the population fits a certain description. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 93 Let r be the binomial random variable, the number of successes out of n independent trials. r pˆ is our approximat ion for p n q 1-p Copyright © Houghton Mifflin Company. All rights reserved. 9 | 94 For large samples (np > 5 and nq > 5): The distributi on of p̂ r is approximat ely normal with n mean m p and standard deviation Copyright © Houghton Mifflin Company. All rights reserved. pq n 9 | 95 Three Types of Tests of Hypotheses for Tests of Proportions • Left-tailed tests • Right-tailed tests • Two-tailed tests Copyright © Houghton Mifflin Company. All rights reserved. 9 | 96 Left-Tailed Test H 0: p = k H 1: p < k Copyright © Houghton Mifflin Company. All rights reserved. 9 | 97 Right-Tailed Test H0: p = k H1: p > k Copyright © Houghton Mifflin Company. All rights reserved. 9 | 98 Two-Tailed Test H0: p = k H1: p k Copyright © Houghton Mifflin Company. All rights reserved. 9 | 99 To Convert p̂ to z : p̂ p z pq n r where p̂ sample statistic n n number of trials p proportion specified in H 0 q 1 p Copyright © Houghton Mifflin Company. All rights reserved. 9 | 100 Testing a Proportion p • Consider a binomial experiment with n trials. • Let p represent the population probability of success. • Let q = 1 p represent the population probability of failure. • Let r be a random variable that represents the number of successes out of the n binomial trials. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 101 Testing a Proportion p • State the null and alternate hypotheses and set the level of significance α. • The number of trials should be sufficiently large so that both np > 5 and nq > 5. (Use p from the null hypothesis.) Copyright © Houghton Mifflin Company. All rights reserved. 9 | 102 Testing a Proportion p r The p̂ distrbutio n can be approximat ed by the n normal distributi on using the standardiz ed test statistic : p̂ p z pq n Copyright © Houghton Mifflin Company. All rights reserved. 9 | 103 Testing a Proportion p • Use the standard normal distribution and the type of test (one-tailed or twotailed) to find the P-value corresponding to the test statistic. • If the P-value < α, then reject H0. If the P-value > α, then do not reject H0. • State your conclusion. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 104 In the past, college officials observed that 40% of students took advantage of early registration. This semester, of 4830 students, 2077 took advantage of early registration. Use a 5% level of significance to test the claim that a higher percentage of students now participates in early registration. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 105 In the past, college officials observed that 40% of students took advantage of early registration. ... H0: m = 0.40 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 106 … test the claim that a higher percentage of students now participates in early registration. H1: m > 0.40 Use a right-tailed test. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 107 … This semester, of 4830 students, 2077 took advantage of early registration. ... r 2077 pˆ 0.43 n 4830 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 108 The corresponding z value: pˆ p 0.43 0.40 z 4.26 pq 0.40(0.60) n 4830 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 109 Use Table 3 to Determine the P-value Associated with z = 4.26, • The P-value is approximately 0.000 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 110 Since α = 0.05 and P < α • We reject the null hypothesis. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 111 Conclusion • Since we have rejected the hypothesis that 40% of students participate in early registration, we conclude that: • A percentage higher than 40% of students now participates in early registration. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 112 Test the hypothesis involving a proportion: H0: p = 0.70 H1: p 0.70 Use a = 0.01 Suppose that in 120 trials there were 80 successes. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 113 We find that: pˆ 0.67 and z 0.72 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 114 Use Table 3 to find the P-value associated with z = –0.72. P(z –0.72) = 0.2358 Since the test is a two-tailed test, double the area in the left tail to find P. P = 2(0.2358) = 0.4716 Copyright © Houghton Mifflin Company. All rights reserved. 9 | 115 When the P-value is greater than the level of significance, we do not reject the null hypothesis. P = 0.4716 a = 0.01 Do not reject the null hypothesis. Copyright © Houghton Mifflin Company. All rights reserved. 9 | 116