Dissertation Statistics Help

Chi-square test calculator

Two categorical variables, one question: are they related? Paste the cross-tab and this returns the test, the effect size, and the assumption check.

The chi-square test of independence asks whether two categorical variables are associated by comparing the counts you observed against the counts expected if the variables were unrelated. Paste a contingency table of any size and this calculator returns the chi-square statistic, its degrees of freedom, the exact p-value, the full table of expected counts, and Cramer's V as the measure of how strong the association is.

Chi-square statistic

9.091

χ²(1) = 9.09, p = .003

Chi-square (χ²)9.091
Degrees of freedom1
p value.003
Table size2 × 2
Total observations100
Cramer's V0.302
Smallest expected count22.50

How the chi-square statistic is built

Each cell's expected count is its row total times its column total divided by the grand total. The statistic sums the squared gap between observed and expected counts, scaled by the expected count, across every cell:

χ² = Σ (O - E)² / E

The degrees of freedom are (rows - 1) × (columns - 1), and the p-value is the upper-tail area of the chi-square distribution beyond the computed statistic. Cramer's V rescales the statistic into a 0-to-1 effect size, √(χ² / (n × (k - 1))), where k is the smaller of the row and column counts. Because the test relies on a large-sample approximation, the calculator also reports the smallest expected count so you can judge whether that approximation holds.

Frequently asked questions

What does a chi-square test tell you?

A chi-square test of independence tells you whether two categorical variables are associated, by comparing the counts you observed with the counts expected if the variables were unrelated. A large chi-square value and a small p-value mean the observed pattern is unlikely under independence, so the variables are associated. The test shows that an association exists but not how strong it is, which is why Cramer's V is reported alongside it.

What is the minimum expected count for a chi-square test?

The usual rule is that no expected count should be below 1 and no more than 20% of cells should have an expected count below 5. When a 2 by 2 table breaches this, Fisher's exact test is the safer choice; for larger tables, combining sparse categories often restores the approximation. This calculator reports the smallest expected count so you can check the assumption before trusting the p-value.

What is the difference between a chi-square test of independence and goodness of fit?

A test of independence uses a two-way contingency table to ask whether two categorical variables are related, while a goodness-of-fit test uses a single row of counts to ask whether one variable matches a hypothesised distribution. They share the same chi-square statistic and distribution but differ in the degrees of freedom and the question. This calculator runs the test of independence for a table of two or more rows and columns.

How do you interpret Cramer's V?

Cramer's V measures the strength of association on a scale from 0 to 1, where 0 is no association and 1 is a perfect one. For a table whose smaller dimension is 2, values around 0.1, 0.3, and 0.5 are often read as small, medium, and large effects, with the thresholds shrinking as the table grows. It complements the chi-square p-value by answering how strong the association is, not just whether it is significant.