Week 9: Hypothesis Testing Errors and Confidence Intervals

Learning Outcomes

  • LO1: Defining and Explaining Errors: Understand how to define and explain Type I and Type II errors within the context of hypothesis testing.

  • LO2: Decision Outcomes and Errors: Distinguish between rejecting and failing to reject the null hypothesis and identify how these decisions relate to Type I and Type II errors.

  • LO3: Confidence Interval Interpretation: Define a confidence interval and explain its interpretation as an interval estimator for a population parameter.

  • LO4: Construction and Interpretation: Construct and interpret confidence intervals for various population parameters.

Overview of Statistical Inference and Review

  • Sampling Distribution Context: In previous sessions (Lecture 6), the sampling distribution for the sample mean (Xˉ\bar{X}) was explored. This was based on simple random samples of n=10n = 10 students drawn from a population of 1,3681,368 students based on test marks (out of 2020 points).

  • Population Parameters: The true population mean (μ\mu) for these test marks was known to be 15.9215.92.

  • Sample Statistics: For each sample, the sample mean (Xˉ\bar{X}), sample variance (s2s^2), and standard deviation (ss) were calculated.

  • Probability of Deviance: While most sample means fell close to the true population mean (15.9215.92), there is a small but finite probability of obtaining a sample mean that is very different from the true mean.

Hypothesis Testing: Decision Scenarios

Scenario A: Correct Decision (Fail to Reject True Null)

  • Hypotheses:

    • H0:μ=15.92H_0: \mu = 15.92

    • HA:μ15.92H_A: \mu \neq 15.92

  • Sample Data: Sample Mean (Xˉ=15.9\bar{X} = 15.9), Sample Variance (s2=9.4333s^2 = 9.4333), Sample Size (n=10n = 10).

  • Critical Value: t0.05/2,9=2.262t_{0.05/2, 9} = 2.262.

  • Decision Rule: Reject H0H_0 if the tt-statistic is greater than 2.2622.262 or less than 2.262-2.262.

  • Test Statistic Calculation:

    • t=Xˉμs/n=15.915.929.4333/10=0.0206t = \frac{\bar{X} - \mu}{s / \sqrt{n}} = \frac{15.9 - 15.92}{\sqrt{9.4333 / 10}} = -0.0206

  • Outcome: Since t=0.0206t = -0.0206 is between 2.262-2.262 and 2.2622.262, and the pp-value (0.97890.9789) is greater than α\alpha (0.050.05), the decision is to not reject the null hypothesis.

  • Conclusion: At a 5%5\% significance level, there is insufficient evidence to conclude the population mean is different from 15.9215.92. This is the correct decision because μ\mu is indeed 15.9215.92.

Scenario B: Type I Error (Rejecting a True Null)

  • Context: Sampling variability means we might occasionally draw a sample with an unusually high or low mean.

  • Sample Data: Sample Mean (Xˉ=18.1\bar{X} = 18.1), Sample Variance (s2=3.6556s^2 = 3.6556), Sample Size (n=10n = 10).

  • Test Statistic Calculation:

    • t=18.115.923.6556/10=2.180.6046=3.6056t = \frac{18.1 - 15.92}{\sqrt{3.6556 / 10}} = \frac{2.18}{0.6046} = 3.6056

  • Outcome: Since t=3.6056>2.262t = 3.6056 > 2.262, and the pp-value (0.00570.0057) is less than α\alpha (0.050.05), the decision is to reject the null hypothesis.

  • Conclusion: This decision is incorrect because the true population mean is 15.9215.92. We have rejected a true null hypothesis, which is a Type I error.

Scenario C: Type II Error (Failing to Reject a False Null)

  • Context: Testing a claim that the average mark (μ\mu) is 14.514.5. We know this claim is false because the true mean is 15.9215.92.

  • Hypotheses:

    • H0:μ=14.5H_0: \mu = 14.5

    • HA:μ14.5H_A: \mu \neq 14.5

  • Sample Data: n=10n = 10, Xˉ=15.9\bar{X} = 15.9, s2=9.4333s^2 = 9.4333.

  • Test Statistic Calculation:

    • t=15.914.59.4333/10=1.4414t = \frac{15.9 - 14.5}{\sqrt{9.4333 / 10}} = 1.4414

  • Outcome: Since t=1.4414<2.262t = 1.4414 < 2.262, the decision is to not reject the null hypothesis.

  • Conclusion: This is an incorrect decision (Type II error) because the null hypothesis was false. This illustrates why we say "fail to reject" rather than "accept"; failing to reject means we lack sufficient evidence against the null, not that the null is definitely true.

Types of Errors in Hypothesis Testing

Type I Error

  • Verbatim Definition: A Type I error is the incorrect decision to reject H0H_0 when H0H_0 is true.

  • Probability: The probability of committing a Type I error is exactly equal to the significance level, denoted by α\alpha.

  • P(Type I Error)=α=P(Reject H0H0 is True)P(\text{Type I Error}) = \alpha = P(\text{Reject } H_0 | H_0 \text{ is True})

Type II Error

  • Verbatim Definition: A Type II error is the decision NOT to reject H0H_0 when it is false.

  • Probability: The probability of committing a Type II error is denoted by β\beta.

  • β=P(Fail to reject H0H0 is False)\beta = P(\text{Fail to reject } H_0 | H_0 \text{ is False})

  • Challenges: Calculating β\beta is difficult because it requires knowing the true population parameter, which is typically unknown in practice.

Factors Influencing Errors and The Trade-off

  • Significance Level ( α\alpha ) Influence:

    • Decreasing α\alpha: Reducing α\alpha (e.g., from 0.050.05 to 0.010.01) makes the rejection region smaller. This reduces the risk of a Type I error but makes it harder to reject the null, thereby increasing the risk of a Type II error (β\beta).

    • Increasing α\alpha: Increasing α\alpha makes it easier to reject the null. This reduces β\beta but increases the risk of a Type I error (α\alpha).

  • Sample Size (nn) Influence:

    • Larger samples reduce variability and improve precision, resulting in a smaller β\beta (lower risk of Type II error).

    • Smaller samples have more variability, resulting in a higher β\beta.

  • Data Variability Influence:

    • Higher variability (ss) leads to less precise estimates and a higher β\beta.

  • Power of a Test:

    • Definition: The probability of correctly rejecting a false null hypothesis (avoiding a Type II error).

    • Power=1P(Type II Error)=1β\text{Power} = 1 - P(\text{Type II Error}) = 1 - \beta

    • A high-power test is desirable as it indicates a strong ability to detect when the null hypothesis is false.

Confidence Intervals (CIs)

Conceptual Basis

  • Point Estimate: A single value (like Xˉ\bar{X}) used to estimate a population parameter. It is limited by sampling variability.

  • Interval Estimator: A range of values constructed from sample data that is likely to contain the true population parameter. It is more informative than a point estimate because it quantifies uncertainty.

Derivation from Hypothesis Testing

  • A confidence interval represents the range of all hypothesised values (μ0\mu_0) for which the null hypothesis H0:μ=μ0H_0: \mu = \mu_0 would not be rejected in a two-tailed test.

  • Non-Rejection Condition: tα/2,n1Xˉμ0s/ntα/2,n1-t_{\alpha/2, n-1} \leq \frac{\bar{X} - \mu_0}{s / \sqrt{n}} \leq t_{\alpha/2, n-1}

  • The Resulting Interval: Xˉtα/2,n1×snμ0Xˉ+tα/2,n1×sn\bar{X} - t_{\alpha/2, n-1} \times \frac{s}{\sqrt{n}} \leq \mu_0 \leq \bar{X} + t_{\alpha/2, n-1} \times \frac{s}{\sqrt{n}}

Confidence Interval for a Mean ( μ\mu )

  • Formula: Xˉ±tα/2,n1×sn\bar{X} \pm t_{\alpha/2, n-1} \times \frac{s}{\sqrt{n}}

  • Properties:

    • The sample mean Xˉ\bar{X} is an efficient estimator of μ\mu.

    • The distribution is Student-t distributed with n1n - 1 degrees of freedom.

    • The interval is symmetric around Xˉ\bar{X}.

  • Interpretation: A (1α)×100%(1 - \alpha) \times 100\% confidence interval means that if we were to repeat the sampling process many times, approximately (1α)×100%(1 - \alpha) \times 100\% of the resulting intervals would contain the true population mean.

  • Important Caveat: We are confident in the method used to construct the interval. We do not say the mean is "certainly" in a specific calculated interval.

Worked Example: Test Marks (n=25n=25)

  • Data: Xˉ=15.68\bar{X} = 15.68, s2=5.7267s^2 = 5.7267, n=25n = 25, α=0.05\alpha = 0.05.

  • Critical Value: t0.025,24=2.064t_{0.025, 24} = 2.064.

  • Standard Error: sn=5.726725=0.4786\frac{s}{\sqrt{n}} = \sqrt{\frac{5.7267}{25}} = 0.4786.

  • CI Calculation:

    • 15.68±2.064×0.478615.68 \pm 2.064 \times 0.4786

    • 15.68±0.98815.68 \pm 0.988

    • Interval: [14.749,16.531][14.749, 16.531]

  • Hypothesis Link: Any H0:μ=μ0H_0: \mu = \mu_0 where μ0\mu_0 is outside this range (e.g., 1717 or 1414) would be rejected at the 5%5\% level. Values inside (e.g., 1616 or 1515) would not be rejected.

Precision and Length of Confidence Intervals

  • Length Formula: L=2×tα/2,n1×snL = 2 \times t_{\alpha / 2, n - 1} \times \frac{s}{\sqrt{n}}

  • Informativeness:

    • Short Interval: Indicates the sample is highly informative about the parameter.

    • Wide Interval: Indicates higher uncertainty; the sample is less informative.

  • Ways to achieve a shorter (more precise) interval:

    1. Smaller population variability (ss).

    2. Larger sample size (nn).

    3. Lower confidence level (e.g., 90%90\% instead of 99%99\%, which reduces the critical value tt).

Confidence Intervals for Other Parameters

Population Proportion (PP)

  • Use Case: Constructing intervals for proportions, such as urban dwellers in Victoria.

  • Formula: p^±tα/2,n1×p^(1p^)n\hat{p} \pm t_{\alpha/2, n-1} \times \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}

  • Example Calculations: If p^=0.270\hat{p} = 0.270, n=1000n = 1000, s.e.(p^)=0.012s.e.(\hat{p}) = 0.012, and t=2.581t = 2.581 (for 99%99\% confidence):

    • 0.270±2.581×0.014=[0.234,0.306]0.270 \pm 2.581 \times 0.014 = [0.234, 0.306]

Difference Between Two Independent Means (μ1μ2\mu_1 - \mu_2)

  • Use Case: Comparing average wages between urban and regional dwellers.

  • Formula: (Xˉ2Xˉ1)±tα/2,n1+n22×s12n1+s22n2(\bar{X}_2 - \bar{X}_1) \pm t_{\alpha/2, n_1+n_2-2} \times \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}

  • Example Calculation: Xˉ2Xˉ1=9,510.46\bar{X}_2 - \bar{X}_1 = 9,510.46, t=1.962t = 1.962, combined Standard Error = 1,689.661,689.66.

    • 9,510.46±1.962×1,689.66=[6,195.36,12,825.57]9,510.46 \pm 1.962 \times 1,689.66 = [6,195.36, 12,825.57]

  • Note: A wide interval here reflects high uncertainty in the estimated difference in earnings.

Difference Between Two Independent Proportions (P1P2P_1 - P_2)

  • Formula: (p^1p^2)±tα/2,n1+n22×p^1(1p^1)n1+p^2(1p^2)n2(\hat{p}_1 - \hat{p}_2) \pm t_{\alpha/2, n_1+n_2-2} \times \sqrt{\frac{\hat{p}_1(1 - \hat{p}_1)}{n_1} + \frac{\hat{p}_2(1 - \hat{p}_2)}{n_2}}

  • Note: For large sample sizes, the t-distribution provides a good approximation of the standard normal distribution.

Mean of the Differences (Matched Pairs) (μD\mu_D)

  • Formula: XˉD±tα/2,n1×sDn\bar{X}_D \pm t_{\alpha/2, n-1} \times \frac{s_D}{\sqrt{n}}

Summary Keywords

  • Error Types: Type I error, Type II error, Probability of errors (α\alpha, β\beta).

  • Test Performance: Power of a test (1β1 - \beta), Error trade-offs.

  • Estimation: Point estimate, Interval estimator, Confidence Level (1α1 - \alpha), Confidence Limits (Upper and Lower).