Advertisement

Chi-square calculator

Choose distribution calculations or a Pearson test. Count-based tests use independent observations and require sufficiently large expected counts.

Calculator

Chi-square value
2.000000
Degrees of freedom
2.000000
Cumulative probability
63.212056%
Right-tail probability
36.787944%
Density
0.183940

Advertisement

How this calculator works

Distribution mode uses a central chi-square law with positive degrees of freedom. Critical mode inverts its right tail. Goodness of fit compares matching observed and expected counts with equal totals, subtracting fitted parameters from the degrees of freedom. Contingency mode derives expected counts from row and column totals; it applies no continuity correction. Small expected counts are flagged.

Formula

χ² = Σ(O-E)²/E; goodness-of-fit df = categories - 1 - fitted parameters; contingency E_ij = row_i × column_j / total; df = (rows-1)(columns-1).

Worked example

Observed counts 10, 20, 30 versus expected 20, 20, 20 give χ² = 5 + 0 + 5 = 10 and df = 2. The right-tail p-value is exp(-5) = 0.00673795.

Advertisement

Frequently asked questions

Is a p-value the probability that the hypothesis is true?

No. It is the probability, under the null model and approximation, of a statistic at least this large.

Can I use percentages as observed counts?

Enter the actual independent counts. Percentages hide the sample size and change the statistic.

What if expected counts are small?

The asymptotic p-value may be inaccurate. An exact or simulation-based test may be more appropriate.

Sources

Advertisement