Hypothesis testing

Hypothesis test calculator

Seven standard tests from pasted raw data. Each one reports the test statistic, degrees of freedom and p-value, and states the assumptions it is making about your data.

⚠️ These calculators use the most common conventions (Student's equal-variance t-test; no Yates' continuity correction on the 2×2 chi-square test). Good for a first pass and homework — for formal research, follow your course/instructor's method and check the underlying assumptions (normality, equal variances, etc.).

Enter the four cells of a 2×2 contingency table (a/b are row 1, c/d are row 2).

Group summary

GroupnMean
Common uses
  • Checking whether two sets of scores differ significantly
  • Checking whether categorical survey data matches expected proportions
  • Hypothesis-test calculations for homework or a project

The seven tests on this page

TestAnswersData needed
One-sample t-testDoes this group's mean differ from a known value?One column + a reference mean
Two-sample t-testDo two independent groups differ?Two columns
Paired t-testDid the same subjects change?Two matched columns
χ² goodness of fitDo observed counts match expected proportions?Observed + expected counts
χ² 2×2 independenceAre two categorical variables related?Four cell counts
Pearson correlationIs the linear relationship non-zero?Two paired columns
One-way ANOVADo three or more groups differ?One column per group

If you are not sure which of these fits your question, the test selection wizard asks what you are trying to find out and sends you here with the right test already chosen.

Worked example: paired vs. independent

Twelve students take a test before and after a revision course. Their scores rise by an average of 4 points, with a standard deviation of differences of 5.

The paired t-test gives t = 4 ÷ (5 ÷ √12) = 2.77 on 11 df, p = 0.018 — significant.

Analysing the same numbers as two independent samples would typically give a much larger standard error, because between-student variation (some students are simply stronger) swamps the within-student change. The pairing is what removes that noise. Choosing the wrong one of these two tests is the single most consequential mistake on this page.

Assumptions, and what this tool does about them

Every test here makes assumptions, and this tool does not check them for you. The important ones:

  • The two-sample t-test here is Student's, not Welch's. It assumes the two groups have equal population variances. When variances differ and the groups are unequally sized, Student's test can be badly wrong in either direction. Welch's t-test is now the recommended default in most guidance, and if your group SDs differ by more than roughly a factor of two you should not rely on the figure here.
  • The 2×2 χ² is uncorrected. No Yates' continuity correction is applied. With any expected cell count below about 5 the uncorrected statistic is anti-conservative — it will find significance too readily — and Fisher's exact test is the right tool instead.
  • ANOVA assumes homogeneity of variance across groups, and tells you only that some pair of groups differs. It does not tell you which. That requires a post-hoc test such as Tukey's HSD, which this tool does not provide.
  • t-tests assume approximate normality of the sampling distribution. The central limit theorem makes this forgiving at moderate sample sizes, but with n below about 15 and visibly skewed data, a non-parametric alternative is safer.
  • Pearson's r assumes a linear relationship. A strong curved relationship can produce an r near zero. Always look at a scatter plot before concluding there is no association.

These are stated plainly rather than buried because they change conclusions. If your situation trips one of them, the number this page produces will still be arithmetically correct and substantively misleading.

Reading the output

Each test reports the test statistic, its degrees of freedom, and the p-value. The statistic and df together determine the p-value, and reporting all three is the convention — t(22) = 2.31, p = .031 — because it lets a reader reconstruct the result and check it.

What none of these tests report is how big the difference is. A significant t-test on 5,000 participants may reflect a difference of no practical consequence. Take the group means and SDs and convert them into Cohen's d before deciding a result matters.

Common mistakes

  • Running a t-test on three groups, pairwise. Three pairwise tests at α = 0.05 give roughly a 14% chance of at least one false positive. Use ANOVA, then a corrected post-hoc test.
  • Feeding percentages into a χ² test. Chi-square requires raw counts. Percentages destroy the sample size information the test depends on, and will produce a meaningless statistic.
  • Treating a Likert item as continuous without thinking. Sometimes defensible for a summed multi-item scale; rarely defensible for a single 1–5 item.
  • Deciding on the test after seeing the results. Trying several tests and reporting the one that reached significance invalidates the p-value entirely.

The method used here

t-test and ANOVA p-values come from the regularised incomplete beta function; χ² p-values from the regularised lower incomplete gamma function. Both use the series expansion or continued-fraction form depending on argument size, following the standard Numerical Recipes treatment, capped at 500 iterations with a 10⁻¹⁴ relative tolerance. The correlation test converts r to t via t = r√(n−2) ÷ √(1−r²) on n − 2 degrees of freedom.

Very large pasted datasets are truncated, and when that happens the result panel says so explicitly rather than silently analysing a subset.

Sources

  • Delacre, M., Lakens, D. & Leys, C. (2017). Why psychologists should by default use Welch's t-test. International Review of Social Psychology, 30(1), 92–101.
  • Press, W. H. et al. (2007). Numerical Recipes (3rd ed.), §6.2 and §6.4.
  • Campbell, I. (2007). Chi-squared and Fisher–Irwin tests of two-by-two tables. Statistics in Medicine, 26(19), 3661–3675.