T-test Calculators
0 calculators tagged with “T-test”
All Calculators
No calculators found for this topic.
Independent Samples t-test
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)
df ≈ n₁ + n₂ − 2 (equal variances) or Welch–Satterthwaite (unequal variances). One-tailed or two-tailed p-value from t-distribution.
Paired t-test
t = d̄ / (sd / √n)
d = difference for each pair; d̄ = mean difference; sd = SD of differences; df = n − 1. More powerful than independent samples t-test when within-subject variation is high.
Welch's t-test (unequal variances)
Same formula as independent t-test; df = Welch–Satterthwaite formula (different from Student's); always use Welch's unless variances are proven equal (Levene's test). Welch's is more robust.
Assumptions
- Normal distribution (or large n by CLT)
- Independent observations
- Continuous outcome variable
- For Student's (not Welch's): equal variances
Glossary
Frequently Asked Questions
A t-test compares the means of two groups to determine if the difference is statistically significant. Use a t-test when: comparing exactly two groups (for > 2 groups use ANOVA); outcome is continuous and approximately normally distributed; sample sizes are small to moderate (for large n, central limit theorem normalizes distributions). Types: Independent samples t-test: two separate groups (e.g., control vs. treatment; drug A vs. drug B). Paired t-test: same subjects measured twice (e.g., before vs. after treatment; left vs. right eye). Welch's t-test: independent groups with unequal variances (default choice in most software). Not appropriate for: count data (use χ² or Poisson regression); more than two groups (use ANOVA); non-normal small samples (use Mann-Whitney U).
t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂). x̄₁, x̄₂ = sample means. s₁², s₂² = sample variances. n₁, n₂ = sample sizes. df: Welch–Satterthwaite (if variances unequal); or n₁ + n₂ − 2 (pooled, equal variances). Example: group 1: n=15, x̄=25, s=4; group 2: n=12, x̄=22, s=5. t = (25−22) / √(16/15 + 25/12) = 3 / √(1.067 + 2.083) = 3 / √3.15 = 3/1.775 = 1.69. Compare t = 1.69 to t-distribution with Welch df → obtain p-value (two-tailed).
Paired t-test: t = d̄ / (s_d / √n). d = difference between paired measurements. d̄ = mean of differences. s_d = standard deviation of differences. df = n − 1 (n = number of pairs). More powerful when: within-subject variation is high; subjects are heterogeneous (vary widely from each other) — pairing removes between-subject variation from the error term, leaving only within-subject change. Example: measuring blood pressure before and after drug treatment in the same 20 patients. Paired t-test uses the change within each patient as data, reducing noise from between-patient differences. Same as a one-sample t-test of whether mean difference = 0.
Welch's t-test is a modification of the independent samples t-test for unequal population variances. Formula: same as Student's t-test. Degrees of freedom: Welch–Satterthwaite equation: df = (s₁²/n₁ + s₂²/n₂)² / [(s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)]. Why preferred: Student's t-test assumes equal variances (homoscedasticity); this assumption is frequently violated. If variances are unequal and Student's is used: inflated Type I error when sample sizes differ. Welch's controls Type I error correctly regardless of variance equality. Modern recommendation: always use Welch's t-test by default; no need to test for equal variances first (the pre-test for equal variances is unreliable). R: t.test() uses Welch's by default; add var.equal=TRUE for Student's. Python scipy: ttest_ind() uses Student's by default; add equal_var=False for Welch's.