Home

Chi-Square Test

Chi-square goodness-of-fit test calculator. Enter observed and expected counts to compute χ², degrees of freedom and the p-value—for statistics hypothesis-test homework.

展开更多 ▾
χ² = Σ(O−E)²/E
observed per group
theoretical per group, same length

📖 Tutorial | Chi-Square Test

1. Definition
Chi-square goodness-of-fit compares observed O with expected E: χ²=Σ(O−E)²/E, df=groups−1. Larger χ² and smaller p reject “good fit”.
2. Symbols
SymbolMeaning
Oobserved count
Eexpected count
χ²test statistic
dfdegrees of freedom = k−1
3. How it works
  • Sum (O−E)²/E over groups;
  • df=k−1;
  • p is the upper-tail probability under χ²;
  • p<0.05 means a significant discrepancy.
4. Steps
  1. Enter observed counts;
  2. Enter expected counts;
  3. Click Calculate;
  4. Decide by p<0.05.
5. Example
Example: observed 8,12,20; expected each 13.33. χ²≈5.6, df=2, p≈0.0608, not significant (do not reject).
6. Pitfalls
Observed and expected must have the same length;
Expected counts should ideally be ≥5;
This is goodness-of-fit (df=k−1).

❓ FAQ | Chi-Square Test

What is the chi-square test for?
To test whether an observed distribution matches a theoretical one (goodness of fit).
How is df computed?
For goodness of fit it is groups minus 1, k−1.
What does p<0.05 mean?
The observed and expected differ significantly; reject “good fit”.
What if expected counts are small?
Prefer expected ≥5; otherwise combine categories or use exact methods.
Is χ² always positive?
Yes; each term is a square divided by a positive number.