How to use this calculator
- Enter or choose observed counts.
- Enter or choose expected counts or ratios (optional).
- Enter or choose parameters estimated from the data.
- Enter or choose significance level (α).
- The χ² statistic updates as you type. Use Copy result or Share to keep it.
Method
χ² = Σ (O − E)² ÷ E; df = categories − 1 − estimated parameters; p = P(χ²_df ≥ observed χ²)
- O
- observed count in a category
- E
- expected count = total × expected proportion
- df
- degrees of freedom
Worked example
- Total = 556. Expected for 9:3:3:1 = 312.75, 104.25, 104.25, 34.75.
- χ² = 2.25²/312.75 + 3.75²/104.25 + 3.25²/104.25 + 2.75²/34.75 = 0.016 + 0.135 + 0.101 + 0.218 = 0.470.
- With 3 degrees of freedom, P(χ² ≥ 0.470) = 0.925, far above 0.05; the 5% critical value is 7.815.
Mendel’s pea counts fit the 9:3:3:1 ratio very well: χ² = 0.47 with 3 df, p = 0.93.
What the result means
A small p-value means the counts are unlikely under the expected proportions. A large p-value does not prove the proportions are right, only that the data cannot rule them out. The table shows which categories contribute most to the statistic.
Assumptions and limits
- Observations are independent and each falls into exactly one category.
- Expected counts are at least 5 in every category (a common rule for the chi-square approximation).
- The test is right-tailed: only large χ² values count against the null hypothesis.
- Enter raw counts, not percentages or averages; the statistic depends on the actual sample size.
- For small expected counts use an exact multinomial test or merge categories.
Questions
How many degrees of freedom?
Categories minus one, minus one more for each parameter you estimated from the same data to build the expected counts.
Is this the same as the chi-square test of independence?
No. Independence uses a two-way table and df = (rows − 1)(columns − 1). This test compares one set of counts with fixed proportions.