📐

Chi-Square (Goodness of Fit) Calculator

Calculate the chi-square statistic and degrees of freedom for a goodness-of-fit test comparing observed counts to expected counts across up to 3 categories.

Observed frequency for Category 1.
Expected frequency under the null hypothesis for Category 1.
Enter 0 for both observed and expected if only 2 categories.

Results

Chi-Square Statistic1.2,500 chi-sq
Degrees of Freedom2 degrees of freedom

📖What is it?

The chi-square goodness-of-fit test compares observed categorical frequencies to expected frequencies under a null hypothesis. The statistic is: chi-sq = sum((O - E)^2 / E). A larger chi-square value indicates greater discrepancy between observed and expected counts.

🎯How to use

Enter observed and expected counts for each category (up to 3). Set both observed and expected to 0 for Category 3 if you only have 2 categories. Compare the chi-square result to critical values from the chi-square distribution table at your chosen alpha level and the displayed degrees of freedom.

💡Example scenario

Testing a die for fairness: 60 rolls, expected = 10 each for 6 faces. Enter 3 pairs and add more mentally: chi-sq = sum((O-10)^2/10) for all 6. With 5 df, critical value at p<0.05 is 11.07. If chi-sq > 11.07, the die is unfair. For 2 categories (e.g. coin flip): 55 heads vs 45 tails, expected 50 each. chi-sq = (55-50)^2/50 + (45-50)^2/50 = 0.5 + 0.5 = 1.0, df=1. Critical value = 3.84. Not significant.

🏆Pro tip

Chi-square critical values (alpha = 0.05): df=1 -> 3.841; df=2 -> 5.991; df=3 -> 7.815; df=4 -> 9.488; df=5 -> 11.07. Rule of thumb: all expected cell counts should be >= 5 for the chi-square approximation to be valid. For 2x2 tables (1 df), apply Yates' continuity correction: chi-sq = sum((|O-E| - 0.5)^2 / E). For very small expected counts, use Fisher's Exact Test instead.