Calculator Input
Enter category labels plus observed values. Then enter expected proportions or expected frequencies. The page will calculate chi-square, p-value, residuals, and decision.
Example Data Table
This sample uses four color categories with an equal expected split. It demonstrates how the calculator converts category differences into chi-square contributions.
| Category | Observed | Expected Proportion | Expected Count | Contribution |
|---|---|---|---|---|
| Red | 18 | 0.25 | 20 | 0.2000 |
| Blue | 22 | 0.25 | 20 | 0.2000 |
| Green | 25 | 0.25 | 20 | 1.2500 |
| Yellow | 15 | 0.25 | 20 | 1.2500 |
| Total | 80 | 1.00 | 80 | 2.9000 |
Formula Used
Chi-square goodness-of-fit statistic:
χ2 = Σ ((Oi - Ei)2 / Ei)
Here, Oi is the observed count and Ei is the expected count for category i.
Degrees of freedom: df = k - 1 - m
In this expression, k is the number of categories and m is the number of estimated parameters subtracted from the test.
Effect size: w = sqrt(χ2 / n)
This effect size helps describe the practical magnitude of deviation from the expected distribution.
How to Use This Calculator
- Enter each category label on its own line.
- Enter the observed frequency for every category in the same order.
- Choose whether expected entries are proportions or expected frequencies.
- Paste expected proportions, percentages, or frequencies in matching order.
- Select your significance level and add estimated parameters if needed.
- Press the calculate button to view the result above the form.
- Review chi-square, p-value, residuals, assumptions, and export buttons.
Frequently Asked Questions
1. What does this calculator test?
It tests whether observed categorical counts differ significantly from an expected distribution. The tool reports chi-square, p-value, degrees of freedom, residuals, and a decision using your chosen significance level.
2. Should I enter proportions or frequencies?
Use proportions or percentages when you know the target share for each category. Use expected frequencies when you already have raw expected counts. The calculator supports both methods.
3. Why are expected values rescaled sometimes?
Goodness-of-fit testing compares observed totals with matching expected totals. If your expected frequencies do not sum to the observed total, the calculator rescales them proportionally and shows a note.
4. What are standardized residuals?
Standardized residuals show which categories contribute most to the chi-square statistic. Larger absolute values indicate categories where observed counts differ more strongly from expectation.
5. What assumptions matter most?
Counts should be independent, categories should be mutually exclusive, and expected counts should usually be at least 5 in most cells. Very small expected counts can weaken the approximation.
6. What does the effect size mean?
Effect size w measures the practical strength of deviation from the expected distribution. Small p-values show significance, while w helps describe whether the difference is trivial or substantial.
7. When should estimated parameters be subtracted?
Subtract estimated parameters when the expected distribution was fitted from the same sample, such as when probabilities depend on parameters estimated from data. This adjusts degrees of freedom.
8. Can I export the results?
Yes. After calculation, you can download a CSV summary, create a PDF report, or print the result directly. The exported table includes the category-level calculations.