Student's t-test, comparison of means
t = (x̄ − μ₀) / (s / √n) (one sample, n − 1 degrees of freedom)
Compare a sample mean to a reference value, or the means of two independent samples using Welch's t-test (which does not assume equal variances). Choose a two-tailed or one-tailed test and an alpha threshold: the tool calculates the t-statistic, degrees of freedom, p-value and confidence interval, then draws a cautious conclusion about rejecting the null hypothesis.
Scientific dossier
What the tool computes, what it assumes, where it stops being valid, and where its data comes from.
Method & formulast = (x̄ − μ₀) / (s / √n) (one sample, n − 1 degrees of freedom)
t = (x̄ − μ₀) / (s / √n) (one sample, n − 1 degrees of freedom)
t = (x̄₁ − x̄₂) / √(s₁² / n₁ + s₂² / n₂) (two samples, Welch's test)
df = (s₁² / n₁ + s₂² / n₂)² / [ (s₁² / n₁)² / (n₁ − 1) + (s₂² / n₂)² / (n₂ − 1) ]
The t-statistic relates the observed difference to the standard error of that difference. With two samples, Welch's t-test replaces the pooled standard error of the classical t-test with a sum that never assumes equal variances, and adjusts the degrees of freedom accordingly (Welch–Satterthwaite formula, usually fractional).
- H0
- · null hypothesis: the mean equals μ₀, or the two means are equal.
- p-value
- · probability of observing a difference at least as extreme as the one measured, if H0 were true. A small p-value makes H0 implausible; it never proves H0 true when it is large.
- Alpha threshold
- · decision threshold chosen before the calculation (often 0.05). H0 is rejected when the p-value is less than or equal to it.
- Confidence interval
- · range of plausible values for the mean (one sample) or the difference between means (two samples), at level 1 − alpha. For a one-tailed test, only one bound is constrained; the other extends to infinity.
- Welch's t-test
- · variant of the two-sample t-test that does not assume equal variances between the two groups, a safer default choice than the classical t-test, whose equal-variance assumption is rarely verifiable in practice.
Validity domainThe t-test assumes data are approximately normally distributed, or a large enough sample size for the central limit theorem to apply.
The t-test assumes data are approximately normally distributed, or a large enough sample size for the central limit theorem to apply. With a very small sample (fewer than ten values) and a manifestly skewed distribution, results should be interpreted with caution. Zero variance (all values identical) makes the test impossible: standard deviation in the denominator would be zero.
A large p-value proves nothingFailing to reject H0 means only that the data do not allow us to exclude it, never that it is proven true.
Failing to reject H0 means only that the data do not allow us to exclude it, never that it is proven true. A too-small sample often yields a high p-value even when a true difference exists: absence of evidence is not evidence of absence.