📈 Chi-Square Goodness-of-Fit Test

Test whether your observed categorical counts match an expected distribution. Enter observed frequencies, choose how to define expected values, and receive the χ² statistic, degrees of freedom, p-value, critical region, Cramér’s V, and an interpretation with step-by-step guidance.

1. Provide Observed Counts

Provide one non-negative integer per category. At least two categories required.

Expected Distribution

Significance Level (α)

Custom α must fall between 0.001 and 0.25.

Parameter Adjustments

Formula Reference

The chi-square goodness-of-fit statistic is

\\[ \chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i}, \qquad \text{df} = k - 1 - m \\]

where \\(O_i\\) and \\(E_i\\) denote observed and expected counts for category \\(i\\), \\(k\\) is the number of categories, and \\(m\\) is the number of parameters estimated from data to compute \\(E_i\\). Effect size can be summarised by \\(V = \sqrt{\chi^2 / (n(k-1))}\\).

How to Use This Calculator

  1. Enter observed counts for each category (all non-negative, at least two categories, total > 0).
  2. Select how to derive expected counts: uniform distribution, custom counts, or custom probabilities.
  3. Specify the significance level \\(\alpha\\) and any parameters estimated from data (e.g., when estimating mean from the sample).
  4. Click “Run χ² Test” to obtain the statistic, degrees of freedom, p-value, critical value, and Cramér’s V.
  5. Review the step-by-step notes, residuals, and references to interpret and report the result.

References

  • McHugh, M. L. (2013). “The chi-square test of independence.” Biochemia Medica, 23(2), 143–149.
  • Agresti, A. (2013). Categorical Data Analysis (3rd ed.). Wiley.
  • Casella, G., & Berger, R. L. (2002). Statistical Inference (2nd ed.). Duxbury.
  • Montgomery, D. C., & Runger, G. C. (2014). Applied Statistics and Probability for Engineers (6th ed.). Wiley.

Disclaimer

Ensure expected counts are sufficiently large (rule of thumb ≥ 5) and observations are independent. When expected counts are small, consider exact or simulation-based methods.