A little context. A clearer answer.
When this calculator is useful
Calculate Pearson’s chi-square statistic, degrees of freedom and upper-tail p-value from a count table. Enter your values and inspect the calculation details. For a related calculation, try Binomial probability calculator.
What to enter
| Input | What it means | Example value |
|---|---|---|
| Observed count table | One row per line or semicolon, with space-separated observed counts. Use counts, not percentages or precomputed expected values. | 10 20 20 10 |
How the calculation works
- Calculate row totals Rᵢ, column totals Cⱼ and grand total N; independence gives Eᵢⱼ = RᵢCⱼ/N.
- Sum (Oᵢⱼ − Eᵢⱼ)²/Eᵢⱼ and use df = (rows − 1)(columns − 1).
- Find the upper-tail χ² probability and inspect every expected count and cell contribution.
Eᵢⱼ = RᵢCⱼ/N; χ² = Σ(Oᵢⱼ − Eᵢⱼ)²/Eᵢⱼ; df = (r − 1)(c − 1)A worked example
Worked example: Rows 10 20 and 20 10 give expected counts 15, χ² = 6.666667, df = 1 and p ≈ 0.98233%.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
For independent observations in a 2–10 by 2–10 contingency table. Counts must be integers from 0 to 1,000,000,000 with positive row and column totals. Uses the asymptotic Pearson test without Yates correction; small expected counts can invalidate the approximation. This is not a goodness-of-fit test.
Frequently asked questions
Is Yates correction applied to a 2 × 2 table?
No. The output is the uncorrected Pearson statistic for every supported table size.
What if expected counts are small?
The asymptotic p-value may be unreliable. Review the sampling design and consider an appropriate exact or resampling method.
Does a small p-value prove causation?
No. It concerns compatibility with independence under the model, not effect size, causation or practical importance.