Chi-Square Goodness-of-Fit

Chi-square = sum((observed - expected)^2 / expected) on k-1 df, the p-value from the chi-square CDF.

Run the calculator

Example

You enter

You get

Details, formula, and sources

Chi-square = sum((observed - expected)^2 / expected) on k-1 df, the p-value from the chi-square CDF, and a reject / fail-to-reject verdict at alpha. Expected entered as counts or proportions; flags expected counts below 5. Per OpenIntro Statistics Ch. 6.

Chi-square statistic = sum((observed - expected)^2 / expected) over k categories, on k - 1 degrees of freedom. p-value = 1 - chi2Cdf(chi-square, k - 1). Expected proportions are scaled to the observed total. Reject H0 (the observed counts follow the expected distribution) when p < alpha.

OpenIntro Statistics 4th ed. Chapter 6 (inference for categorical data) by name; the chi-square CDF via the regularized lower incomplete gamma function per Numerical Recipes in C 2nd ed. §6.2.

OpenIntro Statistics free at openintro.org; Numerical Recipes chapters free at numerical.recipes.

Estimate only. Readability formulas and similar metrics are derived from a representative population and have known edge-case noise. The classroom teacher governs final text selection, grade placement, and assessment decisions.

Field names used by the API: observed, expected, expected_type, alpha, chi_square, df, p_value

Related tools