---
title: "Chi-square test of independence"
method_id: SM.DIF.CAT.RXC.CHI2IND
family: Difference
version: 1.1.0
date_modified: 2026-06-18
canonical: https://clarus.ofrencber.com/library/chi_square_independence.md
source: Clarus method library
---

# Chi-square test of independence

> A classical statistical method in the Clarus library (Difference family).
> Clarus selects, assumption-checks and runs this method on your data with a
> deterministic rule engine and real numerical libraries (scipy / statsmodels);
> it never generates numbers, citations or results.

**Also known as:** Pearson chi-square test; chi-square test of association; contingency-table test; r x c chi-square.

## Hypotheses

- **Null (H0):** {var1} and {var2} are independent (the joint distribution equals the product of the marginals).
- **Alternative (H1):** {var1} and {var2} are associated (observed cell frequencies depart from those expected under independence).

## When to use it

Use this method when your goal is to:
- test association between two categoricals
- compare proportions across groups
- contingency table independence

## Data it expects

- **dependent:** not_applicable (symmetric association)
- **independent:** 2 nominal variables forming an r x c contingency table
- **pairing:** independent (each observation lands in exactly one cell)
- **sample_size:** [object Object]

## Assumptions Clarus checks

- **expected frequency** (gate: expected_frequency; severity: warning; on violation: reroute)
- **independence of observations** (severity: critical; on violation: reroute)

## Effect size reported

- **cramers v** (Cramér (1946); V = sqrt(chi2 / (N * (min(r,c) - 1))))

## Honest limitations

- The chi-square test detects association but says nothing about its direction or which categories drive it — read the adjusted standardized residuals.
- With a large sample even a negligible association becomes statistically significant; always read Cramér's V alongside the p-value.
- A significant association is not evidence of causation unless subjects were randomly assigned.
- The test is symmetric: report it as an association between the two variables, not as one variable 'affecting' or 'differing on' the other.
- If p >= alpha, this is absence of evidence of association, not proof that the variables are independent; the minimum detectable effect describes what the study could realistically rule out.
- The chi-square approximation requires adequately large expected counts; sparse tables can give misleading p-values.

## Primary sources

- Pearson, K. (1900). On the criterion that a given system of deviations from the probable in the case of a correlated system of variables... Philosophical Magazine, 50(302), 157-175. https://doi.org/10.1080/14786440009463897
- Cramér, H. (1946). Mathematical Methods of Statistics. Princeton University Press.
- Cochran, W. G. (1954). Some methods for strengthening the common chi-square tests. Biometrics, 10(4), 417-451. https://doi.org/10.2307/3001616
- Haberman, S. J. (1973). The analysis of residuals in cross-classified tables. Biometrics, 29(1), 205-220. https://doi.org/10.2307/2529686
- Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum.
- Agresti, A. (2013). Categorical Data Analysis (3rd ed.). Wiley, Ch. 3.
- Field, A. (2013). Discovering Statistics Using IBM SPSS Statistics (4th ed.), Ch. 18.

## How to cite this

To cite this Clarus method page (the page itself — for the method's own primary sources, see above):

**Plain text**

Clarus, "Chi-square test of independence", version 1.1.0, Clarus method library, 2026. https://clarus.ofrencber.com/library/chi_square_independence.md

**APA**

Clarus. (2026). Chi-square test of independence (Version 1.1.0) [Statistical method, Clarus method library]. Retrieved from https://clarus.ofrencber.com/library/chi_square_independence.md

**BibTeX**

```bibtex
@misc{clarus-chi-square-independence,
  author       = {Clarus},
  title        = {Chi-square test of independence},
  howpublished = {Clarus method library},
  version      = {1.1.0},
  year         = {2026},
  url          = {https://clarus.ofrencber.com/library/chi_square_independence.md}
}
```

_No DOI is minted for Clarus method pages yet; this citation uses the canonical URL, version and date. Cite the primary sources above for the method's scientific provenance._

---

METHOD SM.DIF.CAT.RXC.CHI2IND · VERSION 1.1.0 · UPDATED 2026-06-18 · SOURCE Clarus method library
