Calculate t-test results for comparing means. Part of the DevTools Surf developer suite. Browse more tools in the Statistics collection.
Use Cases
Determine whether a new drug treatment produces significantly different outcomes compared to a control group.
Test whether mean response times differ significantly between two versions of an algorithm.
Compare pre-test and post-test scores for the same students to measure learning outcomes.
Evaluate whether two manufacturing processes produce components with significantly different mean dimensions.
Tips
Use the independent-samples t-test when comparing two unrelated groups; use paired t-test when comparing the same subjects under two conditions — choosing wrong inflates or deflates the test statistic.
Check the assumption of equal variances before running an independent t-test: if Levene's test is significant (p < 0.05), use Welch's t-test instead.
Report effect size (Cohen's d) alongside the p-value — a significant t-test on a large sample can detect trivially small differences that are not practically meaningful.
Fun Facts
The t-test was developed by William Sealy Gosset, a statistician at Guinness Brewery in Dublin, who published it under the pseudonym 'Student' in 1908 because Guinness prohibited employees from publishing research.
The t-distribution approaches the normal distribution as sample size increases. At n=30, the difference between t and z critical values is less than 2% — explaining why 30 is often cited as the sample size threshold for switching to z-tests.
Student's t-test was considered controversial when introduced — Karl Pearson, the dominant statistician of the era, initially rejected it. It gained wide acceptance only after Ronald Fisher mathematically proved its validity in the 1920s.
FAQ
When should I use a t-test instead of ANOVA?
Use a t-test for comparing exactly two groups. Use ANOVA for three or more groups — running multiple t-tests inflates the Type I error rate. ANOVA compares all groups simultaneously while controlling the family-wise error rate.
What is a one-sample t-test?
It tests whether a sample mean is significantly different from a known or hypothesized population value. Example: testing whether the mean weight of a package sample equals the 500g stated on the label.