How to use it
- Choose the test. The z-test, one-sample, two-sample and paired t-tests compare means; the chi-square tests compare counts.
- Enter your numbers, either as mean, standard deviation and sample size or as the raw data where the test allows.
- Choose the alternative hypothesis (two-tailed, right-tailed or left-tailed) and the significance level α.
- The address bar holds your inputs, so a link brings the same test back. The values shown at first are examples.
The tests
| Test | Statistic | Degrees of freedom |
|---|---|---|
| z-test for a mean (σ known) | z = (x̄ − μ₀) / (σ/√n) | none |
| One-sample t-test | t = (x̄ − μ₀) / (s/√n) | n − 1 |
| Two-sample t-test (Welch) | t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) | Welch–Satterthwaite |
| Two-sample t-test (pooled) | t = (x̄₁ − x̄₂) / (sₚ√(1/n₁ + 1/n₂)) | n₁ + n₂ − 2 |
| Paired t-test | a one-sample t-test on the differences | pairs − 1 |
| Chi-square goodness of fit | χ² = Σ (O − E)²/E | categories − 1 |
| Chi-square independence | χ² = Σ (O − E)²/E | (rows − 1)(columns − 1) |
What the p-value means
The p-value is the probability of a result at least as extreme as yours if the null hypothesis were true. When it is below your significance level α the result is called statistically significant and the null hypothesis is rejected. It is not the probability that the null hypothesis is true, and a small p-value does not say that an effect is large.
Checked against R
The calculator reproduces R’s output for the same data: for the sleep data, t.test gives t = −1.8608, df = 17.776, p = 0.07939 (Welch) and t = −4.0621, df = 9, p = 0.002833 (paired); chisq.test on the table 762 327 468 / 484 239 477 gives χ² = 30.07, df = 2, p = 2.954·10⁻⁷.
Common questions
Welch or pooled?
Welch’s test does not assume equal variances and loses almost nothing when they are equal, so it is the default. Tick the box for the pooled test only when your course asks for it.
One-tailed or two-tailed?
Use a one-tailed test only when the direction was decided before seeing the data. Otherwise use two-tailed.
To describe a list of numbers first, use the statistics calculator.