What this calculator does
A t-test checks whether a difference in means is bigger than chance would explain. This calculator runs a two-sample t-test (Welch's or pooled) or a one-sample t-test straight from summary statistics, the means, standard deviations and sample sizes, and gives the t statistic, degrees of freedom and p-value.
How to use it
- Choose two samples or one sample.
- Enter each sample's mean, standard deviation and size. For one sample, enter the mean to test against.
- For two samples, choose Welch's test (unequal variances, the safer default) or pooled (equal variances).
- Choose a two-tailed test, or a one-tailed test in the direction you expected.
How to calculate a t-test
- Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂), with Welch–Satterthwaite degrees of freedom
- Pooled: t = (x̄₁ − x̄₂) ÷ (sₚ √(1/n₁ + 1/n₂)), with sₚ² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2) and n₁ + n₂ − 2 degrees of freedom
- One sample: t = (x̄ − μ₀) ÷ (s ÷ √n), with n − 1 degrees of freedom
- The p-value comes from Student's t distribution with those degrees of freedom.
Examples
Example 1: Comparing two classes. One class of 25 averaged 82 (SD 8) and another of 28 averaged 77 (SD 9). Welch's test gives t = 2.1412 with 51 degrees of freedom and p = 0.037058: significant at the 5% level.
Example 2: One sample against a target. 36 measurements average 103 with an SD of 12. Against a target of 100, t = 3 ÷ (12 ÷ 6) = 1.5 and p = 0.142582, not significant.
Tips
- Significant isn't the same as important. With big samples, tiny differences can be significant.
- Use a one-tailed test only if you chose the direction before seeing the data.
- The t-test assumes roughly normal data or samples of about 30 or more. For a z-score's p-value, use the p-value calculator; for an interval, the confidence interval calculator.