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.

Chi-square test of independence vs goodness of fit

The two members of the chi-square family answer different questions from different data. The chi-square test of independence works on a two-way contingency table and asks whether two categorical variables are related, for example whether degree program is associated with preferred study method. The goodness-of-fit test works on a single row of counts and asks whether one variable matches a hypothesised distribution, such as whether responses are spread evenly across five options or follow a known population split.

Both tests share the same statistic and the same chi-square distribution, so they look identical on the page; the difference lives in the degrees of freedom and in what the expected counts represent. Independence derives its expected counts from the row and column totals, while goodness of fit derives them from the hypothesised proportions you supply. If you are unsure which categorical procedure fits your question at all, the guide to choosing a statistical test maps the design to the right test before you run anything.

Using the chi-square distribution table for critical values

Before software made exact p-values routine, every chi-square result was judged against a chi-square distribution table, and knowing how that table works still clarifies what the test is doing. You enter the table with two pieces of information: the degrees of freedom, which equal (rows minus one) times (columns minus one) for a test of independence, and your chosen alpha level, usually .05. The cell where they meet is the critical value. If your computed statistic exceeds it, the result is significant.

For a 2 by 2 table you have one degree of freedom and a critical value of 3.84 at alpha .05, so any chi-square above 3.84 rejects independence. As the table grows, the critical value climbs because more cells offer more chances for random departures. The calculator above skips the lookup and returns the exact upper-tail p-value directly, which is what you report, but the table view explains why the same statistic can be significant in a small table yet not in a large one. For the meaning of the probability itself, see how to read a p-value.

Chi-square assumptions and expected cell counts

The chi-square test rests on a short list of assumptions, and the one that bites most often concerns the expected cell counts. The statistic relies on a large-sample approximation that holds only when the expected counts are reasonably large. The standard rule is that no expected count should fall below 1 and that no more than 20% of cells should have an expected count under 5. When too many cells are sparse, the chi-square p-value becomes untrustworthy and can flag an association that is not really there.

The other assumptions are that observations are independent, so each participant contributes to exactly one cell, and that the data are genuine frequency counts rather than percentages or means. When a 2 by 2 table breaks the expected-count rule, Fisher's exact test is the safer substitute because it computes the probability directly instead of approximating it. For larger tables, collapsing rarely used categories into a sensible combined group usually restores the approximation. The calculator reports the smallest expected count so you can check this before trusting the result.

Cramer's V: effect size for the chi-square test

A significant chi-square tells you an association exists, not how strong it is, and with a large sample even a faint relationship clears significance. That is why Cramer's V belongs beside every chi-square result. It rescales the statistic onto a 0-to-1 range, where 0 means no association and 1 means the two variables move together perfectly, giving you a sample-size-independent read on strength that the raw statistic cannot provide.

Interpreting Cramer's V depends on the table size. When the smaller dimension of the table is 2, values near 0.1, 0.3, and 0.5 are commonly read as small, medium, and large, and these benchmarks shrink as the table grows because larger tables spread the association across more cells. Treat the cut points as guides, not verdicts, and interpret the value against typical effects in your field. For how this fits the wider family of standardised measures, see effect sizes explained or compute related metrics with the dedicated effect size tool.

Reporting chi-square results in APA style

APA style reports a chi-square result in one compact sentence: χ²(df, N = sample size) = value, p = exact value. A worked example reads χ²(1, N = 180) = 6.41, p = .011, and the sample size sits inside the parentheses alongside the degrees of freedom, a detail many write-ups omit. Give the statistic to two decimals, report the exact p-value, and add Cramer's V as the effect size right after it.

Follow the statistic with a plain sentence naming the direction of the association, since the test itself never states which categories drive it; point the reader to the cells where observed counts most exceeded expected counts. For the full conventions on symbols, italics, and table presentation, follow the APA reporting guide, and let the APA formatting tool assemble the sentence if you would rather check it than write it.

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.