Chi-Square Test Calculator
Calculate chi-square statistic for goodness-of-fit and test of independence. Determine if observed frequencies significantly differ from expected, or if two categorical variables are associated.
Formula & Reference
| Variable | Symbol | Formula | Units |
|---|---|---|---|
| Chi-Square Test Calculator | — | χ² = Σ (O - E)² / E | dimensionless |
Step-by-Step Examples
Roll a die 60 times. Observed: 12,8,13,10,9,8. Expected: 10 each (fair die).
- χ² = (12-10)²/10 + (8-10)²/10 + (13-10)²/10 + (10-10)²/10 + (9-10)²/10 + (8-10)²/10
- = 0.4+0.4+0.9+0+0.1+0.4 = 2.2
- df = 6-1 = 5, critical χ² = 11.07
- 2.2 < 11.07: die appears fair
Expected: 25 clicked from each of 3 groups (n=75 total). Observed: 30, 20, 10.
- χ² = (30-25)²/25 + (20-25)²/25 + (10-25)²/25
- = 1 + 1 + 9 = 11
- df = 2, critical χ² = 5.991
- 11 > 5.991: significant difference between groups
Expected by genetics: 75 tall, 25 short (3:1 ratio). Observed: 70, 30.
- χ² = (70-75)²/75 + (30-25)²/25
- = 0.333 + 1.0 = 1.333
- df = 1, critical = 3.841
- 1.333 < 3.841: consistent with 3:1 ratio
Real-World Applications
Common Mistakes to Avoid
Each expected cell must be ≥5 for valid chi-square test. If not: combine categories, use Fisher's exact test (for 2×2 tables), or collect more data.
GOF: df = categories - 1 (minus estimated parameters). Independence: df = (rows-1)(cols-1). Always check df before looking up critical value.
Significant chi-square means the variables are related — it does not tell you why or in which direction the effect goes.
Frequently Asked Questions
Related Math Calculators
Formula Explorer connections
Interpretation: This formula summarizes data, models uncertainty or supports inference about a population or random process. Assumption: The sampling design and distribution assumptions must match the data. Independence, sample size, outliers and measurement quality can materially affect interpretation.