Test categorical distributions using flexible expected-value options. See p-values, degrees of freedom, residuals, and diagnostics. Download reports quickly and compare observed patterns with confidence.
| Category | Observed | Expected Probability | Expected Count |
|---|---|---|---|
| Red | 52 | 0.25 | 37.50 |
| Blue | 43 | 0.25 | 37.50 |
| Green | 31 | 0.25 | 37.50 |
| Yellow | 24 | 0.25 | 37.50 |
This example tests whether four categories follow an equal theoretical distribution.
Chi-square statistic: χ² = Σ ((O − E)² / E)
Degrees of freedom: df = k − 1 − m
Expected count from probability: E = N × p
Effect size: w = √(χ² / N)
O is the observed frequency. E is the expected frequency. k is the number of categories. m is the number of estimated parameters. N is the total sample size.
The chi-square goodness of fit test checks whether a categorical sample matches a theoretical distribution. It compares observed frequencies with expected frequencies and measures the gap using a summed standardized distance. Larger test statistics show stronger disagreement between the model and the data.
This page supports three common workflows. You can enter direct expected counts, work from expected probabilities, or test equal proportions across all categories. The probability option is useful when a theory gives percentages. The count option is useful when a benchmark table already exists.
The calculator also subtracts estimated parameters from the degrees of freedom. That matters when your expected distribution was partly estimated from the same data. Residuals and category-level contributions identify which categories drive the final chi-square statistic. Effect size helps you judge practical importance beyond simple significance.
Always inspect expected counts before trusting the approximation. When some categories are sparse, combine meaningful groups or use an exact alternative when appropriate. The included graph makes it easier to compare observed and expected patterns visually before reporting your conclusion.
It checks whether observed category frequencies match a specified theoretical distribution. The null hypothesis says the sample follows the expected pattern.
Yes. Enter probabilities for each category. The calculator converts them into expected counts by multiplying each probability by the total observed sample size.
Expected counts determine the denominator in each chi-square contribution. Very small expected counts can make the approximation unstable and weaken interpretation.
The calculator normalizes them automatically and adds a note. This keeps the model coherent and matches the observed sample total.
They show which categories differ most from expectation. Large positive values mean more cases than expected. Large negative values mean fewer cases than expected.
If the expected distribution was estimated from the same sample, the model used information from the data. Subtracting parameters adjusts the test accordingly.
It summarizes the overall strength of the mismatch between observed and expected distributions. It complements the p-value with a practical magnitude measure.
No. It only shows that the sample distribution differs from the stated expectation. The difference may be small, meaningful, or caused by model misspecification.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.