Statistics
Chi-Square Calculator
Run a chi-square (χ²) goodness-of-fit test or a chi-square test of independence for contingency tables. Get the χ² statistic, degrees of freedom, p-value, critical χ², expected counts, cell/category contributions, and effect size (Cohen’s w / Cramér’s V).
Note: χ² tests assume independent observations and generally require sufficiently large expected counts (often “most ≥ 5”).
If expected counts are small, consider combining categories or using exact alternatives when appropriate.
Run a Chi-Square Test
Choose a mode, enter observed counts (and expected proportions/counts if needed), then calculate. Chi-square tests are right-tailed, so the p-value is computed from the upper tail.
| Category | Observed (O) | Expected proportion (pᵢ) |
|---|
Goodness of fit compares observed counts to expected counts (often derived from expected proportions).
The test statistic is χ² = Σ (O−E)²/E. Degrees of freedom are df = k − 1 − m (k categories, m parameters estimated from data).
The independence test checks whether two categorical variables are related.
Enter observed counts in the r×c table. Expected counts are Eᵢⱼ = (row total × column total) / n.
Degrees of freedom: df = (r−1)(c−1).
This section is handy when you already know df and you need a critical χ² threshold or a p-value for a given χ² statistic.
Chi-square tests use the right tail: p = P(Χ² ≥ χ²_observed).
| α (right-tail) | Meaning | Typical use |
|---|---|---|
| 0.10 | Less strict threshold | Exploratory screening |
| 0.05 | Common default | Standard hypothesis testing |
| 0.01 | More strict threshold | High-stakes decisions / multiple testing caution |