Chi-Square Calculator

Compare observed counts to expected counts and compute the chi-square statistic for goodness-of-fit tests.

Separate values with spaces or commas.

Chi-square Statistic

1.458

Degrees of freedom: 2

CategoryObservedExpected(O − E)² / E
125.0030.000.833
230.0030.000.000
345.0040.000.625

How to Use This Calculator

  1. Enter observed counts for each category.
  2. Enter expected counts under the null hypothesis for the same categories.
  3. Confirm the lists are the same length to compute χ² and degrees of freedom.
  4. Compare the statistic to chi-square critical values or compute a p-value.

Formula

χ² = Σi (Oi − Ei)² / Ei

Degrees of freedom for a goodness-of-fit test equal the number of categories minus one. Subtract any parameters estimated from the data to adjust the degrees of freedom.

Frequently Asked Questions

What minimum expected value is acceptable?

Common practice requires expected counts at least 5. Combine categories when necessary to meet this guideline.

How do I find the p-value?

Use a chi-square distribution table or software to compute P(Χ² ≥ statistic) with the reported degrees of freedom.

Can this be used for contingency tables?

Yes. Use row and column totals to derive expected counts, then apply the same χ² formula to assess independence.

What if expected counts arise from parameter estimation?

Reduce degrees of freedom by the number of estimated parameters to maintain accurate significance levels.