Chi-Square Test of Independence

Test whether two categorical variables are independent using a contingency table.

Please verify you are human to use the calculator.

About the Chi-Square Test of Independence

The chi-square test of independence determines whether two categorical variables are associated by comparing observed cell frequencies in a contingency table with the frequencies expected under the null hypothesis of independence. It is one of the most commonly used tests in survey analysis, market research, and biomedical studies.

A key validity requirement is that expected cell frequencies must not be too small: every cell should have an expected count of at least 1, and at least 80% of cells should have expected counts of 5 or greater. When these conditions are not met, Fisher's exact test should be used instead. Each observation must also belong to exactly one cell—if subjects can appear in multiple categories, the independence assumption is violated.

Because the chi-square statistic is proportional to sample size, very large samples can make trivially small associations statistically significant while very small samples may lack the power to detect meaningful associations. Always supplement the p-value with an effect size measure such as Cramér’s V to gauge whether the association has practical importance.

A test result carries weight only when the hypothesis, the sample size and the decision rule were fixed before the data arrived. Every pilot we scope is built the same way, with success criteria and kill gates agreed in advance. That work is described under AI pilot design.

Related calculations

  • Fisher exact: For a sparse two-by-two table, inspect an exact test rather than relying only on the chi-square approximation.
  • Chi-square goodness-of-fit test: Use goodness of fit for one categorical variable against specified category probabilities.
  • Chi squared: Inspect the asymptotic reference distribution for the independence statistic.
  • Two proportion z test: For two independent binary groups, compare the corresponding success proportions.

Related Tools

Stay in the loop

Get notified when new tutorials and deep-dives are published. No spam, unsubscribe anytime.

Chi-Square Test of Independence FAQ

Common questions about the chi-square test of independence