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 6 Statistical Inference & Hypothesis Testing • 6.1 - One Sample Mean μ, Variance σ 2, Proportion π • 6.2 - Two Samples Means, Variances, Proportions μ1 vs. μ2 σ12 vs. σ22 π1 vs. π2 • 6.3 - Multiple Samples Means, Variances, μ1, …, μk σ12, …, σk2 Proportions π1, …, πk CHAPTER 6 Statistical Inference & Hypothesis Testing • 6.1 - One Sample Mean μ, Variance σ 2, Proportion π • 6.2 - Two Samples Means, Variances, Proportions μ1 vs. μ2 σ12 vs. σ22 π1 vs. π2 • 6.3 - Multiple Samples Means, Variances, μ1, …, μk σ12, …, σk2 Proportions π1, …, πk CHAPTER 6 Statistical Inference & Hypothesis Testing • 6.1 - One Sample Mean μ, Variance σ 2, Proportion π • 6.2 - Two Samples Means, Variances, Proportions μ1 vs. μ2 σ12 vs. σ22 π1 vs. π2 • 6.3 - Multiple Samples Means, Variances, μ1, …, μk σ12, …, σk2 Proportions π1, …, πk Example: One Mean “Random Variable” X = Age (years) POPULATION Women in U.S. who have given birth Present: Assume that X follows a “normal distribution” in the population, with std dev σ = 1.5 yrs, but unknown mean μ = ? That is, X ~ N(μ, 1.5). Estimate the parameter value μ. Objective 1: “Parameter Estimation” Improve this point estimate of μ to an “interval estimate” of μ, via the… “Sampling Distribution of X ” standard deviation σ = 1.5 This is referred to as a “point estimate” of μ from the sample. mean μ = ??? size n = 400 {x1, x2, x3, x4, … , x400} FORMULA mean x = 25.6 Population Distribution of X Sampling Distribution of X If X ~ N(μ, σ), then… X ~ N , , for any sample size n. n X = Age of women in U.S. who have given birth “standard error” n Z 1.5 yrs .075 yrs 400 X Z n X standard deviation σ = 1.5 yrs X μ X μ Sampling Distribution of X d | X X -d μ X +d X To achieve Objective 1 — obtain an “interval estimate” of μ — we first ask the following general question: Suppose X is any random sample mean. Find a “margin of error” (d) so that there is a 95% probability that the interval X - d, X + d contains μ. “standard error” 1.5 yrs .075 yrs n 400 Pμ-d P X -d < μ < X μ < X< X + d = 0.95 μ + d = 0.95 +d -d P < Z< = 0.95 s.e. s.e. Z X s.e. Sampling Distribution of X d = (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs Pμ-d | X -d μ d X +d X μ + d = 0.95 X P X - d < μ < X + d = 0.95 “standard error” 1.5 yrs .075 yrs n 400 < X< Z +d -d P < Z< = 0.95 s.e. s.e. Pμ-d μ +0.95 d = 0.95 P X -d < μ < X +d X μ < X< standard normal = 0.95distribution N(0, 1) +d P < Z< = 0.95 s.e. s.e. 0.025 -d -z.025 X s.e. X Z 0.025 Z s.e. +z.025 IMPORTANT DEF’NS and FACTS d is called the “95% margin of error” and is equal to the product of the “.025 critical value” (i.e., z.025 = 1.96) times the “standard error” (i.e., n ). The “confidence level” is 95%. The “significance level” is 5%. For any random sample mean X, the “95% confidence interval” is ( X - margin of error, X + margin of error). It contains μ with probability 95%. In this example, the 95% CI is ( X - 0.147, X + 0.147). For instance, if a particular sample yields x = 25.6 yrs, the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.” d = (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs Pμ-d | X -d μ d X +d X μ + d = 0.95 X P X - d < μ < X + d = 0.95 < X< Z +d -d P < Z< = 0.95 s.e. s.e. Pμ-d μ +0.95 d = 0.95 P X -d < μ < X +d < X< standard normal = 0.95distribution N(0, 1) +d P < Z< = 0.95 s.e. s.e. 0.025 -d -z.025 X s.e. X Z 0.025 Z s.e. +z.025 IMPORTANT DEF’NS and FACTS d = (z.025)(s.e.) d= =(1.96)(.075 (zα/2)(s.e.) yrs) = 0.147 yrs “100(1 – α)%of margin d is called the “95% margin error”of error” and is equal to the product of the “α/2 “.025 critical value” (i.e., zz.025 α/2)= 1.96) times the “standard error” (i.e., n ). The “confidence level” is 95%. 1 – α. The “significance level” is 5%. α. For any random sample mean X, “100(1 – α)% “confidence the “95% confidence interval” interval” is ( X - margin of error, X + margin of error). It contains μ with probability 95%. 1 – α. In this example, the 95% CI is ( X - 0.147, X + 0.147). For instance, if a particular sample yields x = 25.6 yrs, the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.” Pμ-d | X -d μ d X +d X 1-α μ + d = 0.95 X P X - d < μ < X + d = 0.95 1–α < X< Z +d -d P < Z< 1-α = 0.95 s.e. s.e. Pμ-d –dα = 0.95 μ 1+0.95 P X -d < μ < X +d < X< standard normal = 0.95distribution N(0, 1) +d P < Z< = 0.95 s.e. s.e. 0.025 α/2-d -z-z.025 α/2 X s.e. Xα/2 Z 0.025 s.e. Z +z.025 +z α/2 IMPORTANT DEF’NS and FACTS d = (zα/2)(s.e.) “100(1 – α)%of margin d is called the “95% margin error”of error” and is equal to the product of the “α/2 “.025 critical value” (i.e., zz.025 α/2)= 1.96) times the “standard error” (i.e., n ). The “confidence level” is 95%. 1 – α. The “significance level” is 5%. α. For any random sample mean X, “100(1 – α)% “confidence the “95% confidence interval” interval” is ( X - margin of error, X + margin of error). It contains μ with probability 95%. 1 – α. What happens if we change α? Example: α = .01, .05, 1 – α = .99 .10, .95 .90 -2.575 -1.96 -1.645 Pμ-d Why not ask for α = 0, i.e., 1 – α = 1? Because then the critical values → ± ∞. X +d X μ +d = 1-α X P X - d < μ < X + d = 0.95 1–α < X< Z +d -d P < Z< = 1-α s.e. s.e. Pμ-d –dα = 0.95 μ 1+0.95 P X -d < μ < X +d +1.645 +1.96 +2.575 | 0 | X -d μ d < X< standard normal = 0.95distribution N(0, 1) +d P < Z< = 0.95 s.e. s.e. 0.025 α/2-d -z-z.025 α/2 X s.e. Xα/2 Z 0.025 s.e. Z +z.025 +z α/2 IMPORTANT DEF’NS and FACTS 95% margin of error (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs In this example, the 95% CI is ( X - 0.147, X + 0.147). For instance, if a particular sample yields x = 25.6 yrs, the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.” μ | 0.147 P μ - 0.147 < μ + 0.147 = 0.95 P X - 0.147 < μ < X + 0.147 = 0.95 ? X1 X< 0.95 X2 0.025 standard normal distribution N(0, 1) 0.025 X3 X4 In principle, over the long run, the probability that a random interval contains μ will approach 95%. X5 X6 +1.96 -1.96 … etc… BUT…. Z IMPORTANT DEF’NS and FACTS In this example, the 95% CI is ( X - 0.147, X + 0.147). For instance, if a particular sample yields x = 25.6 yrs, the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.” μ | 95% margin of error (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs P μ - 0.147 < μ + 0.147 = 0.95 P X - 0.147 < μ < X + 0.147 = 0.95 X< 0.147 X1 In practice, only a single, fixed interval is generated from a single random sample, so technically, “probability” does not apply. NOW, let us introduce and test a specific hypothesis… 0.95 0.025 standard normal distribution N(0, 1) 0.025 +1.96 -1.96 In principle, over the long run, the probability that a random interval contains μ will approach 95%. BUT…. Z Study Question: Has “age at first birth” of women in the U.S. changed over time? POPULATION Women in U.S. who have given birth Statistical Inference and Hypothesis Testing “Random Variable” X = Age at first birth “Null Hypothesis” Year 2010: Suppose we know that X follows a “normal distribution” (a.k.a. “bell curve”) in the population. That is, X ~ N(25.4, 1.5). standard deviation μ < 25.4 σ = 1.5 • public education, awareness programs • socioeconomic conditions, etc. Present: Is H0: μ = 25.4 still true? Or, is the “alternative hypothesis” HA: μ ≠ 25.4 true? i.e., either μ < 25.4 or μ > 25.4 ? (2-sided) μ > 25.4 Does the sample statistic x = 25.6 tend to support H0, or refute H0 in favor of HA? mean μ = 25.4 {x1, x2, x3, x4, … , x400} FORMULA mean x = 25.6 Objective 2: Hypothesis Testing… via Confidence Interval We have now seen: 95% CONFIDENCE INTERVAL FOR µ = 25.4 25.543 x = 25.6 25.747 “point estimate” for μ BASED ON OUR SAMPLE DATA, the true value of μ today is between 25.543 and 25.747, with 95% “confidence.” FORMAL CONCLUSIONS: NOTE THAT THE CONFIDENCE INTERVAL ONLY DEPENDS ON THE SAMPLE, NOT A SPECIFIC NULL HYPOTHESIS!!! The 95% confidence interval corresponding to our sample mean does not contain the “null value” of the population mean, μ = 25.4. Based on our sample data, we may reject the null hypothesis H0: μ = 25.4 in favor of the two-sided alternative hypothesis HA: μ ≠ 25.4, at the α = .05 significance level. INTERPRETATION: According to the results of this study, there exists a statistically significant difference between the mean ages at first birth in 2010 (25.4 yrs) and today, at the 5% significance level. Moreover, the evidence from the sample data suggests that the population mean age today is older than in 2010, rather than younger. Objective 2: Hypothesis Testing… via Confidence Interval What if…? 95% CONFIDENCE INTERVAL FOR µ We have now seen: 25.053 x = 25.2 “point estimate” for μ 95% CONFIDENCE INTERVAL FOR µ 25.347 = 25.4 25.543 x = 25.6 25.747 “point estimate” for μ BASED ON OUR SAMPLE DATA, the true value of μ today is 25.543 and 25.347, 25.747, with 95% “confidence.” between 25.053 FORMAL CONCLUSIONS: NOTE THAT THE CONFIDENCE INTERVAL ONLY DEPENDS ON THE SAMPLE, NOT A SPECIFIC NULL HYPOTHESIS!!! The 95% confidence interval corresponding to our sample mean does not contain the “null value” of the population mean, μ = 25.4. Based on our sample data, we may reject the null hypothesis H0: μ = 25.4 in favor of the two-sided alternative hypothesis HA: μ ≠ 25.4, at the α = .05 significance level. INTERPRETATION: According to the results of this study, there exists a statistically significant difference between the mean ages at first birth in 2010 (25.4 yrs) and today, at the 5% significance level. Moreover, the evidence from the sample data suggests that the population mean age today is older thanthan in 2010, rather thanthan younger. younger in 2010, rather older. Confidence Interval Objective 2: Hypothesis Testing… via Acceptance Region the null hypothesis H0: μ = 25.4 is indeed true, then… “Null” Sampling Distribution of X 95% margin of error (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs P μ25.253 -- 0.147 μ25.4 + 0.147 0.95 P 25.4 0.147 <<< XXX <<< 25.547 + 0.147 = =0.95 = 0.95 P X - 0.147 < μ < X + 0.147 = 0.95 “standard error” 1.5 yrs .075 yrs n 400 0.95 … and out here… … we would expect a random sample mean X to lie in here, with 95% probability… 0.025 …with 5% probability. 0.025 95% ACCEPTANCE REGION FOR H0 X | X μ 25.4 25.253 μ = 25.4 25.547 Objective 2: Hypothesis Testing… via Acceptance Region We have now seen: 95% ACCEPTANCE REGION FOR H0 25.253 = 25.4 25.547 x = 25.6 IF H0 is true, then we would expect a random sample mean x to lie between 25.253 and 25.547, with 95% probability. FORMAL CONCLUSIONS: NOTE THAT THE ACCEPTANCE REGION ONLY DEPENDS ON THE NULL HYPOTHESIS, NOT ON THE SAMPLE!!! The 95% acceptance region for the null hypothesis does not contain the sample mean of x = 25.6. Based on our sample data, we may reject the null hypothesis H0: μ = 25.4 in favor of the two-sided alternative hypothesis HA: μ ≠ 25.4, at the α = .05 significance level. INTERPRETATION: According to the results of this study, there exists a statistically significant difference between the mean ages at first birth in 2010 (25.4 yrs) and today, at the 5% significance level. Moreover, the evidence from the sample data suggests that the population mean age today is older than in 2010, rather than younger. measures the strength of the rejection Objective 2: Hypothesis Testing… via “p-value” Acceptance- Region the null hypothesis H0: μ = 25.4 is indeed true, then… what is the probability of obtaining a random sample mean that is as, or more, extreme than the one actually obtained? i.e., 0.2 yrs OR MORE away from μ = 25.4, ON EITHER SIDE (since the alternative hypothesis is 2-sided)? = P X 25.2 P X 25.6 = 2 P X 25.6 = 2 P Z 2.667 = P X 25.2 U X 25.6 25.6 X 25.4 ZZ .075 s.e. = 2(0.00383) = 0.0077 0.95 0.025 0.00383 0.025 95% ACCEPTANCE REGION FOR H0 0.00383 | 25.2 25.253 μ = 25.4 25.547 x = 25.6 measures the strength of the rejection Objective 2: Hypothesis Testing… via “p-value” Acceptance- Region the null hypothesis H0: μ = 25.4 is indeed true, then… what is the probability of obtaining a random sample mean that is as, or more, extreme than the one actually obtained? i.e., 0.2 yrs OR MORE away from μ = 25.4, ON EITHER SIDE (since the alternative hypothesis is 2-sided)? = P X 25.2 P X 25.6 = 2 P X 25.6 = 2 P Z 2.667 = P X 25.2 U X 25.6 25.6 X 25.4 ZZ .075 s.e. = 2(0.00383) = 0.0077 10.95 –α α/2 0.025 0.00383 α0.025 /2 100(1 – α)% ACCEPTANCE REGION FOR H0 95% ACCEPTANCE REGION FOR H0 0.00383 | 25.2 -zα/2 25.253 μ = 25.4 +zα/2 25.547 x = 25.6 If p-value < , then reject H0; significance! = .05 ... But interpret it correctly! ~ Summary of Hypothesis Testing for One Mean ~ Assume the population random variable is normally distributed, i.e., X N(μ, σ). NULL HYPOTHESIS H0: μ = μ0 (“null value”) ALTERNATIVE HYPOTHESIS HA: μ μ0 i.e., either μ < μ0 or μ > μ0 (“two-sided”) CONFIDENCE INTERVAL Test null hypothesis at significance level α. zα/2 σ n Compute the sample mean x. Compute the 100(1 – α)% “margin of error” = (critical value)(standard error) Then the 100(1 – α)% CI = (x - margin of error, x + margin of error). Formal Conclusion: Reject null hypothesis at level α, if CI does not contain μ0. Statistical significance! Otherwise, retain it. ~ Summary of Hypothesis Testing for One Mean ~ Assume the population random variable is normally distributed, i.e., X N(μ, σ). NULL HYPOTHESIS H0: μ = μ0 (“null value”) ALTERNATIVE HYPOTHESIS HA: μ μ0 i.e., either μ < μ0 or μ > μ0 (“two-sided”) ACCEPTANCE REGION Test null hypothesis at significance level α. zα/2 σ n Compute the sample mean x. Compute the 100(1 – α)% “margin of error” = (critical value)(standard error) Then the 100(1 – α)% AR = (μ0 - margin of error, μ0 + margin of error). Formal Conclusion: Reject null hypothesis at level α, if AR does not contain x. Statistical significance! Otherwise, retain it. ~ Summary of Hypothesis Testing for One Mean ~ Assume the population random variable is normally distributed, i.e., X N(μ, σ). NULL HYPOTHESIS H0: μ = μ0 (“null value”) ALTERNATIVE HYPOTHESIS HA: μ μ0 i.e., either μ < μ0 or μ > μ0 (“two-sided”) p-value Compute the sample mean x. x - μ0 (shown) Compute the z-score σ n or Test null hypothesis at significance level α. Z ~ N(0, 1) If +, then the p-value = 2 P(Z ≥ z-score ). If –, then the p-value = 2 P(Z ≤ z-score ). z-score Formal Conclusion: Reject null hypothesis if p < α. Statistical significance! Otherwise, retain it. Remember: “The smaller the p-value, the stronger the rejection, and the more statistically significant the result.” Objective 2: Hypothesis Testing… 1-sided tests 2-sided test H0: μ = 25.4 HA: μ 25.4 = P X 25.2 P X 25.6 = 2 P X 25.6 = 2 P Z 2.667 p-value = P X 25.2 U X 25.6 In this case, = .05 is split evenly between the two tails, left and right. = 2(.00383) = .0077 1-sided tests “Right-tailed” H0: μ 25.4 HA: μ > 25.4 Here, all of = .05 is in the right tail. 0.95 0.025 .00383 0.025 95% ACCEPTANCE REGION FOR H0 .00383 | 25.2 25.253 μ = 25.4 25.547 x = 25.6 Objective 2: Hypothesis Testing… 1-sided tests 2-sided test H0: μ = 25.4 HA: μ 25.4 = P X 25.2 P X 25.6 = 2 P X 25.6 = 2 P Z 2.667 p-value = P X 25.2 U X 25.6 In this case, = .05 is split evenly between the two tails, left and right. = 2(.00383) = .00383 .0077 1-sided tests “Right-tailed” H0: μ 25.4 HA: μ > 25.4 Here, all of = .05 is in the right tail. 0.95 0.05 0.025 0.025 .00383 .00383 95% ACCEPTANCE 95% ACCEPTANCE REGION REGION FOR HFOR H0 0 | 25.2 25.253 μ = 25.4 25.547 ? x = 25.6 Objective 2: Hypothesis Testing… 1-sided tests 2-sided test H0: μ = 25.4 HA: μ 25.4 25.2 = P X 25.2 P X 25.6 25.2 = P 2P = 2 P X 25.6 Z Z 2.667 p-value = P X 25.2 U X 25.6 25.2 In this case, = .05 is split evenly between the two tails, left and right. 1-sided tests “Right-tailed” H0: μ 25.4 HA: μ > 25.4 “Left-tailed” H0: μ 25.4 HA: μ < 25.4 Here, all of = .05 is in the right tail. Here, all of = .05 is in the left tail. = 2(.00383) (.99617) = .99617 .00383 0.95 0.05 95% ACCEPTANCE REGION FOR H0 | x = 25.2 μ = 25.4 ? x = 25.6 STATBOT 301 Subject: basic calculation of p-values for ztest CALCULATE… from H 00 Test Statistic x “z-score” = x 00 HA: μ < μ0 nn HA: μ > μ0 HA: μ ≠ μ0? 1 – table entry table entry sign of z-score? – 2 × table entry + 22 ×× (1 (1 –– table table entry) entry) Example: One Mean “Random Variable” X = Age (years) POPULATION Women in U.S. who have given birth Present: Assume that X follows a “normal distribution” in the population, with std dev σ = 1.5 yrs, but unknown mean μ = ? That is, X N(μ, 1.5). Estimate the parameter value μ. standard deviation σ = 1.5 Objective 1: “Parameter Estimation” Improve this point estimate of μ to an “interval estimate” of μ, via the… “Sampling Distribution of X “ But how do we know that the variance is the same as in 2010? This is referred to as a “point estimate” of μ from the sample. mean μ = ??? size n = 400 {x1, x2, x3, x4, … , x400} FORMULA mean x = 25.6 … which leads us to… (1.5)2 = 2.25 in our example All have postively-skewed tails. HOWEVER…… In practice, 2 is almost never known, so the sample variance s 2 is used as a substitute in all calculations!