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
STAT 312 Chapter 7 - Statistical Intervals Based on a Single Sample Chapter 8 - Tests of Hypotheses Based on a Single Sample Chapter 9 - Inferences Based on Two Samples Chapter 10 - Analysis of Variance Chapter 11 - Multifactor Analysis of Variance Chapter 12 - Simple Linear Regression and Correlation (see section 5.2) Chapter 13 - Nonlinear and Multiple Regression Chapter 14 - Goodness-of-Fit Tests and Categorical Data Analysis Chapter 15 - Distribution-Free Procedures Chapter 16 - Quality Control Methods STAT 312 Chapter 7 - Statistical Intervals Based on a Single Sample Chapter 8 - Tests of Hypotheses Based on a Single Sample STAT 312 Chapter 7 - Statistical Intervals Based on a Single Sample • 7.1 - Basic Properties of Confidence Intervals • 7.2 - Large-Sample Confidence Intervals for a Population Mean and Proportion • 7.3 - Intervals Based on a Normal Population Distribution • 7.4 - Confidence Intervals for the Variance and Standard Deviation of a Normal Pop Chapter 8 - Tests of Hypotheses Based on a Single Sample • 8.1 - Hypotheses and Test Procedures • 8.2 - Z-Tests for Hypotheses about a Population Mean • 8.3 - The One-Sample T-Test • 8.4 - Tests Concerning a Population Proportion • 8.5 - Further Aspects of Hypothesis Testing STAT 312 Chapter 7 - Statistical Intervals Based on a Single Sample • 7.1 - Basic Properties of Confidence Intervals • 7.2 - Large-Sample Confidence Intervals for a Population Mean and Proportion • 7.3 - Intervals Based on a Normal Population Distribution • 7.4 - Confidence Intervals for the Variance and Standard Deviation of a Normal Pop Chapter 8 - Tests of Hypotheses Based on a Single Sample • 8.1 - Hypotheses and Test Procedures • 8.2 - Z-Tests for Hypotheses about a Population Mean • 8.3 - The One-Sample T-Test • 8.4 - Tests Concerning a Population Proportion • 8.5 - Further Aspects of Hypothesis Testing STAT 312 Chapter 7 - Statistical Intervals Based on a Single Sample • 7.1 - Basic Properties of Confidence Intervals • 7.2 - Large-Sample Confidence Intervals for a Population Mean and Proportion • 7.3 - Intervals Based on a Normal Population Distribution • 7.4 - Confidence Intervals for the Variance and Standard Deviation of a Normal Pop Chapter 8 - Tests of Hypotheses Based on a Single Sample • 8.1 - Hypotheses and Test Procedures • 8.2 - Z-Tests for Hypotheses about a Population Mean • 8.3 - The One-Sample T-Test • 8.4 - Tests Concerning a Population Proportion • 8.5 - Further Aspects of Hypothesis Testing • Right-cick on image for full .pdf article • Links in article to access datasets 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 μ. “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 POPULATION 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 | X -d μ d X X +d X To obtain an “interval estimate” of μ we first ask the following general question: “standard error” 1.5 yrs .075 yrs n 400 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 μ. 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 STAT 312 Chapter 7 - Statistical Intervals Based on a Single Sample • 7.1 - Basic Properties of Confidence Intervals • 7.2 - Large-Sample Confidence Intervals for a Population Mean and Proportion • 7.3 - Intervals Based on a Normal Population Distribution • 7.4 - Confidence Intervals for the Variance and Standard Deviation of a Normal Pop Chapter 8 - Tests of Hypotheses Based on a Single Sample • 8.1 - Hypotheses and Test Procedures • 8.2 - Z-Tests for Hypotheses about a Population Mean • 8.3 - The One-Sample T-Test • 8.4 - Tests Concerning a Population Proportion • 8.5 - Further Aspects of Hypothesis Testing 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: 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: 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: 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: 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. Approximately 95% of the sample mean values are contained between and 2 n 2 n Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 etc… n is called the 95% margin of error X x1 2 x2 x3 x4 x5 Approximately 95% of the sample mean values are contained between and 2 n 2 n Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 n is called the 95% margin of error X x1 2 x2 x3 x4 x5 Approximately Approximately95% 95%of ofthe theintervals sample mean contained x 2values n arefrom x 2between n to and 2 n 2 n contain , and approx 5% do not. Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 n is called the 95% margin of error X x1 2 x2 x3 x4 x5 Objective: Objective: Hypothesis Hypothesis Testing… Testing… via via Acceptance “p-value” - measures Region the strength of the rejection 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)? 25.6 X 25.4 ZZ .075 s.e. = 2(0.00383) = 0.0077 > 1-pnorm(2.6667) 0.95 > pnorm(-2.6667) > pnorm(25.2, 25.4, .075) [1] 0.003830001 0.025 0.00383 = 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 0.025 95% ACCEPTANCE REGION FOR H0 0.00383 | 25.2 25.253 μ = 25.4 25.547 x = 25.6 - measures Objective: Objective 2:Hypothesis Hypothesis Testing… Testing… via via “p-value” Acceptance Region the strength of the rejection 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 - measures Objective: Objective 2:Hypothesis Hypothesis Testing… Testing… via via “p-value” Acceptance Region the strength of the rejection 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 –α Very informally, the p-value of a sample is the probability (hence a α / 2number between 0 and 1) that it “agrees” with the null hypothesis.α0.025 /2 0.025 Hence a very small p-value indicates strong evidence against the 0.00383 null hypothesis. 0.00383 The smaller the p-value,REGION the stronger the evidence, 100(1 – α)% ACCEPTANCE FOR H0 95% ACCEPTANCE REGION and the more “statistically significant” the findingFOR (e.g., pH<0 .0001). | 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: 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: 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: 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 312 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) Loose Ends… • Normality check? • unknown? • n=? Given: • X ~ N(μ , σ ) Normally-distributed population random variable, with unknown mean, but known standard deviation • H0: μ = μ0 Null Hypothesis • HA: μ ≠ μ0 Alternative Hypothesis (2-sided) • significance level (or equivalently, confidence level 1 – ) • n sample size From this, we obtain… s n x1, x2,…, xn “standard error” s.e. (estimate) x s sample mean sample standard deviation …with which to test the null hypothesis (via CI, AR, p-value). In practice however, it is far more common that the true population standard deviation σ is unknown. So we must estimate it from the sample! Recall that s2 2 ( x x ) i n 1 SS df See Ch. 4.6 (311) Given: • X ~ N(μ , σ ) Normally-distributed population random variable, with unknown mean, but known standard deviation • H0: μ = μ0 Null Hypothesis • HA: μ ≠ μ0 Alternative Hypothesis (2-sided) • significance level (or equivalently, confidence level 1 – ) • n sample size This introduces additional variability from one sample to another… PROBLEM??? From this, we obtain… s n x1, x2,…, xn Not if n is “large”…say, 30. “standard error” s.e. (estimate) x s But what if n < 30? T-test! sample mean sample standard deviation …with which to test the null hypothesis (via CI, AR, p-value). In practice however, it is far more common that the true population standard deviation σ is unknown. So we must estimate it from the sample! Recall that s2 2 ( x x ) i n 1 SS df X ~ N ( , ) How do we check that this assumption is reasonable, when all we have is a sample? { x1 , x2 , x3 ,…, x24 } And what do we do if it’s not, or we can’t tell? Z ~ N(0, 1) IF our data approximates a bell curve, then its quantiles should “line up” with those of N(0, 1). Z X X Z X is a linear function of Z X ~ N ( , ) How do we check that this assumption is reasonable, when all we have is a sample? { x1 , x2 , x3 ,…, x24 } And what do we do if it’s not, or we can’t tell? Sample quantiles Z ~ N(0, 1) IF our data approximates a bell curve, then its quantiles should “line up” with those of N(0, 1). Z X X Z X is a linear function of Z • Q-Q plot • Normal scores plot • Normal probability plot X ~ N ( , ) How do we check that this assumption is reasonable, when all we have is a sample? And what do we do if it’s not, or we can’t tell? IF our data approximates a bell curve, then its quantiles should “line up” with those of N(0, 1). Z X X Z X is a linear function of Z • Q-Q plot • Normal scores plot • Normal probability plot qqnorm(mysample) qqline(mysample) (R uses a slight variation to generate quantiles…) X ~ N ( , ) How do we check that this assumption is reasonable, when all we have is a sample? And what do we do if it’s not, or we can’t tell? IF our data approximates a bell curve, then its quantiles should “line up” with those of N(0, 1). Z X X Z X is a linear function of Z • Q-Q plot • Normal scores plot • Normal probability plot qqnorm(mysample) qqline(mysample) (R uses a slight variation to generate quantiles…) Formal statistical tests exist; see notes. Method can be extended to other models X ~ N ( , ) How do we check that this assumption is reasonable, when all we have is a sample? And what do we do if it’s not, or we can’t tell? Use a mathematical “transformation” of the data (e.g., log, square root,…). x = rchisq(1000, 15) hist(x) y = log(x) hist(y) X is said to be “log-normal.” How do we check that this assumption is reasonable, when all we have is a sample? X ~ N ( , ) And what do we do if it’s not, or we can’t tell? Use a mathematical “transformation” of the data (e.g., log, square root,…). qqnorm(x, pch = 19, cex = .5) qqline(x) qqnorm(y, pch = 19, cex = .5) qqline(y) How do we check that this assumption is reasonable, when all we have is a sample? X ~ N ( , ) And what do we do if it’s not, or we can’t tell? Use a mathematical “transformation” of the data (e.g., log, square root,…). “Cauchy distribution” 1 1 f ( x) 1 x2 X ~ N ( , ) How do we check that this assumption is reasonable, when all we have is a sample? And what do we do if it’s not, or we can’t tell? Use a mathematical “transformation” of the data (e.g., log, square root,…). So then what???? POPULATION Study Question: Has “Mean (i.e., average) Age at First Birth” of women in the U.S. changed since 2010 (25.4 yrs old)? “Statistical Inference” via… “Hypothesis Testing” Present Day: Assume “Mean Age at First Birth” follows a normal distribution (i.e., “bell curve”) in the population. Population Distribution X H0: pop mean age = 25.4 (i.e., no change since 2010) x4 x1 x2 x3 x5 … etc… x400 The reasonableness of the normality assumption is empirically verifiable, and in fact formally testable from the sample data. If violated (e.g., skewed) or inconclusive (e.g., small sample size), then “distributionfree” nonparametric tests should be used instead… Examples: Sign Test, Wilcoxon Signed Rank Test (= Mann-Whitney U Test) POPULATION Study Question: Has “Mean (i.e., average) Age at First Birth” of women in the U.S. changed since 2010 (25.4 yrs old)? “Statistical Inference” via… “Hypothesis Testing” Present Day: Assume “Mean Age at First Birth” follows a normal distribution (i.e., “bell curve”) in the population. Population Distribution X H0: pop mean age = 25.4 (i.e., no change since 2010) x4 x1 x2 x3 x5 … etc… x400 Sample size n partially depends on the power of the test, i.e., the desired probability of correctly rejecting a false null hypothesis (80% or more). Coming up next!