Chi-Square Statistic Calculator — 公式
## How to Calculate the Chi-Square Statistic
### Formula
**chi-square = Sum of [(Oi - Ei)^2 / Ei]**
For each category, compute the squared difference between observed (O) and expected (E) frequencies, divided by the expected frequency. Sum these components. Larger values indicate greater discrepancy between observed and expected. Degrees of freedom = number of categories - 1.
### Formula
**chi-square = Sum of [(Oi - Ei)^2 / Ei]**
For each category, compute the squared difference between observed (O) and expected (E) frequencies, divided by the expected frequency. Sum these components. Larger values indicate greater discrepancy between observed and expected. Degrees of freedom = number of categories - 1.
计算示例
Three categories with observed frequencies 30, 20, 50 and expected 25, 25, 50.
- Component 1: (30-25)^2/25 = 25/25 = 1.0
- Component 2: (20-25)^2/25 = 25/25 = 1.0
- Component 3: (50-50)^2/50 = 0/50 = 0.0
- Chi-square = 1.0 + 1.0 + 0.0 = 2.0
- df = 3 - 1 = 2