T-Test
GeneralStudent's T-Test
A statistical test that compares the means of one or two groups to determine whether an observed difference is likely real or just due to random sampling variation.
Definition
A t-test is a statistical hypothesis test that compares the means of one or two groups of numeric data to determine whether an observed difference is likely to be real, or simply the product of random sampling variation. It's the standard tool for questions like "did the new checkout page increase average order value?" or "is there a real difference in test scores between two teaching methods?"
The test produces a t-statistic and a corresponding p-value โ the probability of observing a difference this large (or larger) purely by chance if there were truly no difference between the groups. The T-Test Calculator computes both directly from your group data.
Formula
For an independent two-sample t-test with roughly equal variances:
t = (xฬโ โ xฬโ) รท โ(sยฒโ ร (1/nโ + 1/nโ))
where xฬโ and xฬโ are the two group means, sยฒโ is the pooled variance, and nโ, nโ are the sample sizes.
Worked Example
Comparing two website checkout designs: Design A has a mean order value of $58 (n=40, s=12), Design B has a mean of $63 (n=42, s=13). Running these through the t-test formula produces a t-statistic around 1.8, which โ checked against a t-distribution table with the appropriate degrees of freedom โ gives a p-value around 0.08, above the standard 0.05 threshold. This particular sample doesn't provide strong enough evidence to conclude Design B truly outperforms Design A, even though its mean is numerically higher.
Key Things to Know
- Significance is about chance, not importance: a statistically significant result means the difference is unlikely due to chance โ it doesn't automatically mean the difference is large or practically valuable.
- Sample size affects power: small samples can fail to detect a real difference (a false negative), while very large samples can detect trivially small, practically meaningless differences as "significant."
- Choose the right variant: use a paired test for before/after data on the same subjects, and an independent two-sample test for separate groups.
- Pair with a confidence interval: a t-test tells you whether a difference is significant, while a confidence interval tells you the likely range of that difference's true size.
- Related to chi-square, but different data types: t-tests compare means of continuous measurements, while a chi-square test compares frequencies of categories.
Related Calculators
Frequently Asked Questions