Two-sample t-test for difference in means

    Two-Sample t-Test for Difference in Means

    The two-sample t-test for difference in means is a statistical hypothesis test used to compare the means of two independent groups. It is appropriate when you have quantitative data from two separate samples and you want to determine if there is a statistically significant difference between the population means from which these samples were drawn.

    Hypotheses

    Like all hypothesis tests, the two-sample t-test begins with stating null and alternative hypotheses:

    • Null Hypothesis (H₀): There is no difference between the true population means. Typically written as H₀: μ₁ = μ₂ or H₀: μ₁ - μ₂ = 0.
    • Alternative Hypothesis (Hₐ): There is a statistically significant difference between the true population means. This can be one-sided or two-sided:
      • Hₐ: μ₁ ≠ μ₂ (two-sided test)
      • Hₐ: μ₁ < μ₂ (one-sided, left-tailed test)
      • Hₐ: μ₁ > μ₂ (one-sided, right-tailed test)

    Conditions for Inference

    Before conducting a two-sample t-test, several conditions must be met:

    • Random Condition: Data must come from two independent random samples or two groups in a randomized experiment. This ensures representativeness and independence.
    • 10% Condition: When sampling without replacement, both sample sizes (n₁ and n₂) must be less than 10% of their respective population sizes. This ensures independence between observations within each sample.
    • Normal/Large Sample Condition: For each group, one of the following must be true:
      • The population distribution is approximately normal (can be checked with a normal probability plot or histogram).
      • The sample size is large (n ≥ 30 for each group, by the Central Limit Theorem).
      • If the sample size is less than 30, and the population is not known to be normal, inspect a graph (e.g., dot plot, box plot) of the sample data for strong skewness or outliers.
    • Independent Groups Condition: The two groups being compared must be independent of each other. Observations in one group should not influence observations in the other group.

    Test Statistic

    The test statistic for a two-sample t-test is calculated as:

    t = (x̄₁ - x̄₂) - (μ₁ - μ₂) / √(s₁²/n₁ + s₂²/n₂)

    Where:

    • x̄₁ and x̄₂ are the sample means.
    • s₁ and s₂ are the sample standard deviations.
    • n₁ and n₂ are the sample sizes.
    • (μ₁ - μ₂) is the hypothesized difference in population means, which is typically 0 under the null hypothesis.

    This t-statistic follows a t-distribution with degrees of freedom (df). The most conservative estimate for df is the smaller of (n₁ - 1) and (n₂ - 1). However, statistical software uses a more precise, complex formula (Welch-Satterthwaite equation) that often results in a non-integer df. For AP Statistics, understanding that df is related to sample sizes and using technology for exact values is sufficient.

    P-value and Conclusion

    The calculated t-statistic is used to find the P-value, which is the probability of observing a difference in sample means as extreme as, or more extreme than, the one observed, assuming the null hypothesis is true. A small P-value (typically less than a predetermined significance level α, such as 0.05) provides evidence against the null hypothesis, leading to its rejection. If H₀ is rejected, we conclude there is significant evidence of a difference in population means. Otherwise, we fail to reject H₀, meaning there is not enough evidence to conclude a difference.

    Confidence Interval for Difference in Means

    A confidence interval for the difference in means (μ₁ - μ₂) can also be constructed: (x̄₁ - x̄₂) ± t*√(s₁²/n₁ + s₂²/n₂). The critical value t* is found using the t-distribution with the appropriate degrees of freedom and the desired confidence level. If the interval contains 0, it suggests that μ₁ - μ₂ = 0 is a plausible value, consistent with failing to reject H₀. If the interval does not contain 0, it suggests a significant difference.

    Practice questions

    1

    Which condition is primarily addressed by ensuring that both sample sizes are less than 10% of their respective population sizes when sampling without replacement?

    2

    When performing a two-sample t-test, what does the null hypothesis typically state regarding the population means?

    3

    A researcher conducts a two-sample t-test and obtains a P-value of 0.015. If the significance level (α) is 0.05, what conclusion should the researcher make?

    4

    What is the primary purpose of the 'Normal/Large Sample Condition' for a two-sample t-test?

    Practice more free →

    Free AP4U account — unlimited practice, AI grader, and progress tracking.

    Canonical: https://apforu.com/ap/statistics/unit-7-inference-for-quantitative-data-means/two-sample-t-test-for-difference-in-means