Two-Sample t-Test Calculators
0 calculators tagged with “Two-Sample t-Test”
All Calculators
No calculators found for this topic.
Two-Sample t-Test Formula
Equal Variance (Student's t-Test)
t = (x̄₁ − x̄₂) / (sp × √(1/n₁ + 1/n₂))
Where sp = pooled standard deviation = √[(SS₁ + SS₂) / (n₁ + n₂ − 2)]
Degrees of freedom: df = n₁ + n₂ − 2
Unequal Variance (Welch's t-Test)
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
df = Welch-Satterthwaite equation (more complex; calculated by software)
Welch's t-test is generally preferred as it is robust when variances differ and loses little power when they are equal.
Assumptions
- Independence: observations within and between groups are independent
- Approximate normality: each group is approximately normally distributed (can be relaxed for n > 30 by CLT)
- Measurement scale: continuous or interval data
Worked Example
Group 1: n₁ = 15, x̄₁ = 42.3, s₁ = 5.2
Group 2: n₂ = 18, x̄₂ = 38.7, s₂ = 4.8
sp = √[((14 × 27.04) + (17 × 23.04)) / (15 + 18 − 2)] = √[770.24/31] = √24.85 = 4.98
t = (42.3 − 38.7) / (4.98 × √(1/15 + 1/18)) = 3.6 / (4.98 × 0.357) = 3.6 / 1.777 = 2.025
df = 31; p (two-tailed) ≈ 0.051 → borderline non-significant at α = 0.05
Effect Size (Cohen's d)
d = (x̄₁ − x̄₂) / sp
Small: d ≈ 0.2; Medium: d ≈ 0.5; Large: d ≈ 0.8
Always report effect size alongside p-value for complete interpretation.
Glossary
Frequently Asked Questions
A two-sample (independent samples) t-test tests whether the means of two independent groups differ significantly. Use it when: you have two groups (treatment vs. control, male vs. female, method A vs. method B); continuous measurements; approximately normal distributions; and independent observations. It asks: 'Is the difference between group means larger than expected by chance alone?' If p < α (usually 0.05), conclude the means differ significantly.
Student's t-test assumes equal variances between groups and uses a pooled standard deviation. Welch's t-test does not assume equal variances — it uses separate group variances and adjusts degrees of freedom via the Welch-Satterthwaite approximation. Welch's is generally preferred because it performs well when variances are equal AND when they differ, while Student's test gives inflated Type I error when variances are unequal. Default to Welch's unless you have strong evidence of equal variances.
Three key assumptions: (1) Independence — ensured by experimental design (random sampling, no repeated measures, no nested data). (2) Normality — check with histograms, Q-Q plots, or Shapiro-Wilk test; for n > 30 per group, the central limit theorem makes this assumption less critical. (3) Equal variances (Student's only) — check with Levene's or Bartlett's test. If variances are significantly unequal, use Welch's t-test. For small non-normal samples, use Mann-Whitney U test (non-parametric alternative).
Cohen's d = (x̄₁ − x̄₂) / sp — the difference in means expressed in units of pooled standard deviation. It measures practical effect size independent of sample size. Benchmarks: d = 0.2 (small effect — groups overlap ~85%); d = 0.5 (medium — ~67% overlap); d = 0.8 (large — ~53% overlap). A statistically significant result with d = 0.1 may be practically meaningless; a non-significant result with d = 0.7 may reflect inadequate power (too small a sample), not absence of a real effect.