Chi-square goodness-of-fit test
This test compares the distribution of a categorical variable with an expected distribution. Use it to check whether your sample has the same share by region, gender or major as the population, or whether customers pick options equally. Enter how many cases fall in each category and, if you don’t expect equal shares, the expected proportion.
Each category should have the same number of cases.
The calculation runs in your browser. We don’t store what you type.
How it’s calculated
Expected count for each category = N × its expected proportion. With equal shares, N / k.
χ² = Σ (observed − expected)² / expected, with k − 1 degrees of freedom.
Standardized residual = (observed − expected) / √expected. Beyond 1.96 in absolute value, that category departs from what was expected.
Effect size: Cohen’s w = √(χ² / N).
Expected proportions can be percentages or parts: they’re rescaled to add up to 100%.
How to read the result
- p < .05: the observed distribution differs from the expected one. Check the residuals to see which categories.
- p ≥ .05: no evidence that it departs from what was expected. For a sample check, that’s what you want: it resembles the population.
- Cohen’s w: 0.1 small, 0.3 medium and 0.5 large.
- If any expected count is below 5, the result is unreliable: merge categories.
In the glossary: p-value · Effect size · Parametric and non-parametric tests
Step-by-step guideWhich statistical test to use in your thesis: a decision-tree guideHow to choose your thesis’s statistical test: decision tree, table of parametric and non-parametric tests and common mistakes. With a free test selector.Frequently asked questions
- Goodness of fit or test of independence?
- Goodness of fit compares one variable with an expected distribution. Independence compares two variables with each other in a cross table.
- Does it match SPSS?
- Yes. It matches Analyze > Nonparametric Tests > Legacy Dialogs > Chi-square.
- Can it test normality?
- No. To check whether a numeric variable is normal, use Shapiro-Wilk or Kolmogorov-Smirnov.
Know what you want to ask?
Build the survey in SurvIQ, share it by link, WhatsApp or QR code, and watch results come in live. The Free plan is free forever.
Create a free survey