Chapter 10 Hypothesis Tests Regarding a Parameter Ch. 10.1 The Language of Hypothesis Testing Objective A: Set up a Hypothesis Testing Hypothesis testing is a procedure, based on a sample evidence and probability, used to test statements regarding a characteristic of one or more populations. - The null hypothesis H 0 is a statement to be tested. - The alternate hypothesis H1 is a statement that we are trying to find evidence to support. Example 1: Set up H 0 and H1 . (a) In the past, student average income was $6000 per year. An administrator believes the average income has increased. 𝐻0 : = 6000 (No change) 𝐻1 : > 6000 (A right-tailed test) (b) The percentage of passing a Math course was 50%. A Math professor believes there is a decrease in the passing rate. 𝐻0 : = 0.5 (No change) 𝐻1 : < 0.5 (A left-tailed test) Objective B: Type I or Type II Error Type I Error → Rejecting H 0 when H 0 is true. Type II Error → Not rejecting H 0 when H1 is true. We use for the probability of making Type I error. We use for the probability of making Type II error. For this statistics class, we only control the Type I error. (0.01 0.10) is also called the level of significance. Objective C: State Conclusions to Hypothesis Tests If H 0 is rejected, there is sufficient evidence to support the statement in H1 . If H 0 is NOT rejected, there is NOT sufficient evidence to support the statement in H1 . 1 Example 1 : In 2007, the mean SAT score on the reasoning test for all students was 710. A teacher believes that, due to the heavy use of multiple choice test questions, the mean SAT reasoning test has decreased. (a) Determine H 0 and H1 . H0: µ = 710 H1: µ< 710 (No change) (A left-tailed test) (b) Explain what it would mean to make a Type I error. Type I Error Rejecting the H0 when H0 is true. A Type I error is made when the sample evidence leads the teacher to believe µ = 710 is not true when in fact µ = 710 is true. (c) Explain what it would mean to make a Type II error. Type II Error Not rejecting the H0 when H1 is true. A Type II error is made when the sample evidence leads the teacher to believe µ = 710 is true when in fact µ is less than 710. (d) State the conclusion if the null hypothesis is rejected. There is enough evidence to support the teacher's claim that the mean SAT reasoning test score has decreased. Example 2: The mean score on the SAT Math Reasoning exam is 516. A test preparation company states that the mean score of students who take its course is higher than 516. (a) Determine the null and alternative hypotheses that would be used to test the effectiveness of the marketing campaign. H0: p = 516 H1: p > 516 (b) If sample data indicate that the null hypothesis should not be rejected, state the conclusion of the company. There is not sufficient evidence to support the mean score of the reasoning exam is higher than 516. 2 (c) Suppose, in fact, that the mean score of students taking the preparatory course is 522. Has a Type I or Type II error been made? Type II error. If we tested this hypothesis at α = 0.01 level, what is the probability of committing a Type I error? Since α is the probability of committing Type I error, there is a 1% chance of committing a Type I error. (d) If we wanted to decrease the probability of making a Type II error, would we need to increase or decrease the level of significance? If we increase α, we decrease 𝛽 and vice versa. Therefore, we need to increase the level of significance α in order to decrease the probability of Type II error. Example 3: According to the Centers for Disease Control, 15.2% of adults experience migraine headaches. Stress is a major contributor to the frequency and intensity of headaches. A massage therapist feels that she has a technique that can reduce the frequency and intensity of migraine headaches. (a) Determine the null and alternative hypotheses that would be used to test the effectiveness of the message therapist's techniques. H0: p = 0.152 H1: p < 0.152 (b) A sample of 500 American adults who participated in the massage therapists program results in data that indicate that the null hypothesis should be rejected. Provide a statement that supports the massage therapists program. There is sufficient evidence to support that the massage therapists’ program can reduce the percentage of migraine headache from 15.2%. (c) Suppose, in fact, that the percentage of patients in the program who experience migraine headaches is 15.2%. Was a Type I or Type II error committed? Type I error. 3 Ch10.2 Hypothesis Tests for a Population Proportion Objective A: Classical Approach Z Test for a population proportion A hypothesis test involving a population proportion can be considered as a binomial experiment. x The best point estimate of p , the population proportion, is a sample proportion, pˆ . n There are two methods for testing hypothesis. Method 1: The Classical Approach Method 2: The P Value Approach We will briefly introduce the classical approach. The preferred method for this class is the P value approach. Testing Hypotheses Regarding a Population Proportion, p . Use the following steps to perform a Proportion Z Test provided that 4 Objective A : Classical Approach Z Test for a population proportion Example 1: Use the classical approach to test the following hypotheses. H o : p 0.25 versus H1 : p 0.25 n 400 ; x 96 ; 0.1 (a) Setup H 0 and H 1 H0: p = 0.25 H1: p < 0.25 (left-tailed test) (b) Use the sample data of n 400 and x 96 to compute the test statistic and round your answer to four decimal places. 5 𝑥 96 𝑝̂ = 𝑛 = 400 = 0.24 z0 z0 0.24 0.25 (0.25)(1 0.25) 400 pˆ p0 p0 (1 p0 ) n 0.24 0.25 (0.25)(0.75) 400 ≈ -0.4619 *(test statistic) (c) Use = 0.1 level of significance and StatCrunch to determine the critical value(s). Use α to find 𝑧𝛼 (z critical value) Open StatCrunch Stat Calculator Normal Input P(x ≤ ____) = 0.1 (alpha) Compute and record results 𝑧𝛼 = -1.28. (d) Draw the Z distribution that depicts the critical region and the Z statistic. α = 0.1 * 𝑍𝛼 = -1.28 𝑧0 ≈ -0.4619 (e) What conclusion can be drawn? Since Z – statistic, 𝑧0 , is not within the critical region, fail to reject 𝐻0 . There is not enough evidence to support 𝐻1 : p < 0.25. 6 Ch10.3 Hypothesis Testing about a Population Mean with unknown Objective A: Classical Approach t test for a population mean The t test procedure requires either that the sample was drawn from a normally distributed population or the sample size was greater than 30. Minor departures from normality will not adversely affect the results of the test. However, if the data include outliers, the t test procedure should not be used. A normality plot is used to test whether the sample was drawn from a normally distributed population. A boxplot is used to detect outliers. 7 Objective A : Classical Approach t test for a population mean Example 1: Use StatCrunch to determine the critical value(s) for (a) a right-tailed test for a population mean at the 0.05 level of significance based on a sample size of n 18 . Open StatCrunch Stat Calculator T DF: 17, P (x ≥ ____) = 0.05 (alpha), change the direction of the inequality to ≥ for the right-tailed test Compute and record results 𝑡𝛼 = 1.7396067 (b) a left-tailed test for a population mean at the 0.01 level of significance base on a sample size of n 15 . Open StatCrunch Stat Calculator T DF: 14, P (x ≥ ____) = 0.01 (alpha), check the direction of the inequality to ≤ for the left-tailed test Compute and record results 𝑡𝛼 = −2.6244941 8 (c) a two-tailed test for a population mean at 0.05 level of significance based on a sample size of n 25 . For a two-tailed test we must find the amount in each tail by dividing α/2 and we get 0.05/2 = 0.025. Open StatCrunch Stat Calculator T DF: 24, P (x ≥ ____) = 0.025, check the inequality for either test, because due to symmetry our answer will be ± the value given Compute and record results 𝑡𝛼 = ± 2.0638986 9 Example 2: Determine the t statistic and the tail(s) of testing. (a) H 0 : 16 versus 16 A random sample of size n 10 was obtained from a population that was normally distributed produced a mean of 16.5 with a standard deviation of 0.4. (i) Standardize the sample data t0 x 0 16.5 − 16 = = 0.3952847 ≈ 3.953 0.4/√10 s/ n 𝑡0 = 3.953 (ii) Based on 𝐻1 : µ > 16, this is a right-tailed test. (b) H 0 : 72 versus 72 A random sample of size n 15 was obtained from a population that was normally distributed produced a mean of 73.5 with a standard deviation of 17.1. (i) Standardize the sample data x 0 73.5−72 = = 0.33973538 ≈ 0.340 s / n 17.1/√15 (ii) Based on 𝐻1 : µ ≠ 72, this is a two-tailed test. t0 Example 3: Use the classical approach to test H 0 : 0.3 versus 0.3 , a random sample of size n 16 is obtained from a population that is known to be normally distributed. (a) Setup H 0 and H 1 𝐻0 : µ = 0.3 𝐻1 : µ ≠ 0.3 t0 𝜇0 = 0.3, x 0 0.295 0.3 0.119 s n 0.168 16 n = 16, 𝑥̅ = 0.295, s = 0.168 * (b) If x =0.295, s 0.168 , compute the test statistic and round the answer to three decimal places. * 𝑡0 ≈ -0.119 10 (c) If the researcher decides to test this hypothesis at the =0.05 level of significance, Use StatCrunch to determine the critical value(s). Each tail → 0.05/2 = 0.025 Open StatCrunch Stat Calculator T DF: 15, P (x ≥ ____) = 0.025, check the inequality for either test, because due to symmetry our answer will be ± the value given Compute and record results 𝑡𝛼 = ± 2.1314495 (d) Draw a t distribution that depicts the critical region and the t statistic. t0 0.119 * (e) What conclusion can be drawn? Since the test statistic, 𝑡0 , does not fall within the critical region, we fail to reject 𝐻0 . There is not enough evidence to support the 𝐻1 : µ ≠ 0.3. 11 P-Value Approach Ch10.2 Hypothesis Tests for a Population Proportion Objective B: P Value Approach Z Test for a population proportion A hypothesis test involving a population proportion can be considered as a binomial experiment. x The best point estimate of p , the population proportion, is a sample proportion, pˆ , provided the sample is n obtained by 1) simple random sampling; 2) np0 (1 p0 ) 10 to guarantee that a normal distribution can be used to test hypothesis for H 0 : p p0 ; 3) the sampled values are independent of each other (n 0.05 N ) . Testing Hypotheses Regarding a Population Proportion, p . Use the following steps to perform a Z Test for a Proportion. 12 Example 1: The percentage of physicians who are women is 27.9%. In a survey of physicians employed by a large university health system, 45 of 120 randomly selected physicians were women. Use the P value approach to determine whether there is sufficient evidence at the 0.05 level of significance to conclude that the proportion of women physicians at the university health system exceeds 27.9%? x = 45, n = 120, α = 0.05 (a) Setup 𝐻0 : p = 0.279 𝐻1 : p > 0.279 (right-tailed test) (b) Standardize the sample data 𝑥 45 𝑝̂ = 𝑛 = 120 = 0.375 Z= 𝑝̂−𝑝0 𝑝 (1−𝑝0 ) √ 0 𝜎 = 0.375−0.279 √ 0.279(1−0.279) 120 ≈ 2.345 (c) Use StatCrunch to find the P value. Open StatCrunch → Stat → Normal → Standard → P (x ≥ 2.345) = ____ → compute P-value ≈ 0.0095 (d) Draw the Z distribution and shade the area that represents and the P value respectively. 0.0095 𝑧0 = 2.344 (e) What conclusion can be drawn? Since P-value < α, we reject the null hypothesis. There is sufficient evidence to support that the percentage of physicians who are women exceeds 27.9%. 13 Example 2: Redo Example --> Use StatCrunch to calculate part (b) and part (c) in one command. (a) Setup 𝐻0 : p = 0.279 𝐻0 : p > 0.279 (right-tailed test) (b) Use StatCrunch to find Z 0 and its corresponding P value. Open StatCrunch → Stat → Proportion Stats → one sample → with summary → enter # of successes 45, observations 120, value for p = 0.279 , → select HA: p > → compute Hypothesis test results: p : Proportion of successes H0 : p = 0.279 HA : p > 0.279 Proportion Count Total Sample Prop. Std. Err. Z-Stat P-value p 45 120 0.375 0.040942948 2.3447261 0.0095 Z0 ≈ 2.345 p-value ≈ 0.0095 (c) Conclusion Since P-value < α, we reject the null hypothesis. There is sufficient evidence to support that the percentage of physicians who are women exceeds 27.9%. Example 3: In 2000, 58% of females aged 15 years of age and older lived alone, according to the U.S. Census Bureau. A sociologist tests whether this percentage is different today by conducting a random sample of 500 females aged 15 years of age and older and finds that 285 are living alone. Use the P value approach and StatCrunch to determine whether there is sufficient evidence at the 0.10 level of significance to conclude that the proportion has changed since 2000. 𝐻0 : p = 0.58, n = 500, 𝐻1 : p ≠ 0.58 x = 285, (two-tailed test) 285 𝑝̂ = 500 = 0.57 Open StatCrunch → Stat → Proportion Stats → One Sample → with summary → input # of successes 285, observations 500, select Hypothesis test value for p = 0.58, → H1: p ≠ 0.58 → compute and record results Hypothesis test results: p : Proportion of successes H0 : p = 0.58 HA : p ≠ 0.58 Proportion Count Total Sample Prop. Std. Err. Z-Stat P-value p 285 500 0.57 0.022072607 -0.45305024 0.6505 14 Z0 ≈ -0.453 p-value ≈ 0.6505 Open StatCrunch → Stat → Calculator → Normal → P (x ≥ or ≤ ____) = 0.05 → compute and record results ± 1.6448536 Z0 = -0.453 Conclusion: Since P-value (0.6505) is not less than α (0.1), we fail to reject the null hypothesis. There is insufficient evidence to support the claim that the percentage of females aged 15 years and lied alone is different today. P-Value Approach Ch10.3 Hypothesis Testing about a Population Mean with unknown Objective B: P Value Approach t test for a population mean 15 The t test procedure requires either that the sample was drawn from a normally distributed population or the sample size was greater than 30. Minor departures from normality will not adversely affect the results of the test. However, if the data include outliers, the t test procedure should not be used. A normality plot is used to test whether the sample was drawn from a normally distributed population. A boxplot is used to detect outliers. 16 Example 1: (a) Draw a t distribution with the area that represents the P value shaded. (b) Use StatCrunch to find the P value for each test value, t o . (c) Use 0.05 to determine whether to reject H 0 or not. (i) t0 2.624, n 15, (Right-tailed test) (a) Draw a t distribution with the area that represents the P value shaded. (b) Use StatCrunch to find the P value for each test value, t o . Open StatCrunch → Stat → Calculators → T →DF: 14 →P (x ≥ 2.624) → Compute. P-value = (0.0100963) ≈ 0.0101 (c) Use 0.05 to determine whether to reject H 0 or not. Since P-value (0.0100963) is < than α (0.05), we reject the null hypothesis. (ii) t0 2.321, n 23, left-tailed (a) Draw a t distribution with the area that represents the P value shaded. 17 (b) Use StatCrunch to find the P value for each test value, t o . Open StatCrunch → Stat → Calculators → T →DF: 22 →P (x ≤ -2.321) → Compute. P-value = (0.01497327) ≈ 0.0150 (c) Use 0.05 to determine whether to reject H 0 or not. Since P-value (0.01497327) is < than α (0.05), we reject the null hypothesis. (iii) t0 1.562, n 17, two-tailed (a) Draw a t distribution with the area that represents the P value shaded. (b) Use StatCrunch to find the P value for each test value, t o . Open StatCrunch → Stat → Calculators → T →DF: 16→P (x ≤ 1.562) → Compute. Due to symmetry P x is both ≥ for the right tail and ≤ for the left tail. .P-value = (0.06892408) per tail ≈ 0.0689 P-value = (0.06892408)*2 = 0.1378 total (c) Use 0.05 to determine whether to reject H 0 or not. Since P-value (0.1378) is not less than α (0.05), we fail to reject the null hypothesis. There is insufficient evidence to support the claim. 18 Example 3: A survey of 15 large U.S. cities finds that the average commute time one way is 25.4minutes. A chamber of commerce executive feels that the commute in his city is less and wants to publicize this. He randomly selects 25 commuters and finds the average is 22.1 minutes with a standard deviation of 5.3 minutes. At 0.01 , is there enough evidence to support the claim? Use the P value approach. (a) Setup 𝐻0 : µ = 25.4 𝐻1 : µ < 25.4 (left-tailed test) (b) Use StatCrunch to find t o and its corresponding P value. Hypothesis test results: μ : Mean of population H0 : μ = 25.4 HA : μ < 25.4 Mean Sample Mean Std. Err. DF T-Stat P-value μ 22.1 1.06 24 -3.1132075 0.0024 (c) Conclusion.: 𝑡0 = -3.113; P-value ≈ 0.0024. Since P-value (0.0024) < α, reject the 𝐻0 . There is sufficient evidence to support the executive’s claim that the commute time in his city is less than 25.4 minutes. Example 4: Michael Sullivan, son of the author, decided to enroll in a reading course that allegedly increases reading speed and comprehension. Prior to enrolling in the class, Michael read 198 words per minute (wpm). The following data represent the words per minute read for 10 different passages read after the course. (a) Because the sample size is small, we must verify that reading speed is normally distributed and the sample does not contain any outliers. Perform a normal probability plot (QQ plot) and a boxplot. Are the conditions for testing a t hypothesis satisfied? 19 The boxplot indicated there are no outliers. The QQ plot indicated the sample data may have come from a population that is normally distributed because all observed data are close to the straight line. The t-hypothesis testing conditions are satisfied. (b) Was the class effective? Use the 0.10 level of significance. (i) Setup 𝐻0 : µ = 198 𝐻1 : µ > 198 (right-tailed test) (ii) Use StatCrunch to find t o and its corresponding P value. Open StatCrunch → Stats → T Stats → one sample → with data → select var1 → select Hypothesis test for µ → 𝑯𝟎 : µ = 198, 𝐻𝐴 : µ > 198 → compute Hypothesis test results: μ : Mean of variable H0 : μ = 198 HA : μ > 198 Variable Sample Mean Std. Err. DF T-Stat P-value var1 208.4 2.9672284 9 3.5049543 0.0033 𝑡0 = 3.505 P-value ≈ 0.0033 20 (iii) Conclusion. Since P-value (0.0033) < α (0.10), reject 𝐻0 . There is sufficient evidence to support the claim that the reading course improves reading speed. P-Value Approach Ch10 Hypothesis Tests for a Population Standard Deviation (Supplemental Materials) Objective B : P Value Approach 2 Test about a population variance or standard deviation The concepts are similar to the P-value approach for Ch10.2 and Ch10.3 except a Chi-Square distribution is used. To test hypotheses about the population variance or standard deviation, two conditions must be met: 1) the sample is obtained using simple random sampling and 2) the population is normally distributed. Recall: distribution is not symmetric and the values of are non-negative. Example 1: A machine fills bottles with 64 fluid ounces of liquid. The quality-control manager determines that the fill levels are normally distributed with a mean of 64 ounces and a standard deviation of 0.42 ounce. He has an engineer recalibrate the machine in an attempt to lower the standard deviation. After the recalibration, the quality-control control manager randomly selects 19 bottles from the line and determines that the standard deviation is 0.38 ounce. Is there less variability in the filling machine? Use the level of significance α (0.05). (a) Setup 𝐻0 : 𝜎 = 0.42 𝐻1 : 𝜎 < 0.42 (b) Use StatCrunch to find the P value. Open StatCrunch → Variance Stats → one sample → with summary → sample variance 0.382 = 0.1444 → n = 19 → select Hypothesis test for 𝐻0 : 𝜎 2 = 0.422 = 0.1764, 𝐻𝐴 : 𝜎 2 < 0.1764, → compute Hypothesis test results: σ2 : Variance of population H0 : σ2 = 0.1764 HA : σ2 < 0.1764 Variance Sample Var. DF Chi-Square Stat P-value σ2 0.1444 18 14.734694 0.3199 21 (c) Draw the distribution and shade the area that represents and the value respectively. (d) What conclusion can be drawn? Since P-value (0.3199) is not less than α (0.05), fail to reject the 𝐻0 . There is insufficient evidence to support the recalibration of the machine can lower the standard deviation. 22 Example 2: Data obtained from the National Center for Health Statistics show that men between the ages of 20 to 29 have a mean height of 69.3 inches, with a standard deviation of 2.9 inches. A baseball analyst wonders whether the standard deviation of heights of major-league baseball is less than 2.9 inches. The heights (in inches) of 20 randomly selected players are shown below. µ = 69.3 s = 2.9 n = 20 72 74 71 72 76 70 77 75 72 72 77 72 75 70 73 73 75 73 74 74 (a) Verify the data are normally distributed by drawing a normal probability plot. Open StatCrunch → Input raw data → Graph → QQ Plot → var1 → Compute The sample data are close to the straight line. Thus, the data may have come from a population that is normally distributed. (b) Use StatCrunch to compute the sample standard deviation. Open Statcrunch → Stat → Calculators → Summary Statistics → column → var1 → Statistics: Variance → Compute Hypothesis test results: σ2 : Variance of variable H0 : σ2 = 8.41 HA : σ2 < 8.41 Variable Sample Var. DF Chi-Square Stat P-value var2 4.2394737 19 9.5778835 0.0374 (c) Test the notion at the 0.10 level of significance. µ = 69.3 𝜎 = 2.9 n = 20 𝑥̅ = 73.35 𝜎𝑥̅ = 2.0589982 Setup: 𝐻0 : 𝜎 = 2.9 𝐻1 : 𝜎 < 2.9 23 P-Value: Conclusion: 24