Chi-Square Goodness-of-Fit Test
This calculator performs a chi-square goodness-of-fit test. It checks whether the observed category counts
match an expected distribution (given by proportions p or expected counts E).
When to use it
- You have k categories and observed counts O for each category.
- You want to test whether the data follow a claimed set of proportions p (or expected counts E).
- The test is right-tailed: large values of χ2 indicate poor fit.
How to use the calculator
-
Choose an Input mode:
- Provide expected proportions p: you enter p for each category and the calculator uses E = n · p.
- Equal proportions: the calculator uses p = 1/k automatically.
- Provide expected counts E: you enter the expected counts directly.
- Set the significance level α (commonly 0.05).
- Fill the table with your categories and Observed O (and p or E depending on the mode).
- Click Calculate to get χ2, degrees of freedom, p-value, and the decision.
What the results mean
- χ2 summarizes the total mismatch between observed and expected counts.
- df = k − 1 (assuming probabilities are fully specified, not estimated from the sample).
- p-value is the right-tail probability P(χ2 ≥ computed χ2).
-
Decision rule:
- Reject H₀ if p-value ≤ α (or if χ2 ≥ χ21−α).
- Do not reject H₀ otherwise.
Important practical check
The chi-square approximation works best when expected counts are not too small.
A common guideline is that each expected count should be at least 5. If the calculator warns that some
expected counts are below 5, consider combining categories or collecting more data.