Chi-square (χ²) Test#
A test of association between categorical variables using expected counts.
Important
✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.
What it is#
The chi-square test works on categorical data, comparing observed counts to the expected counts under a null hypothesis:
A large \(\chi^2\) means observations stray far from expectation.
Its two forms#
Goodness-of-fit asks whether one categorical variable follows a specified distribution (do dice rolls look fair?); independence asks whether two categorical variables in a contingency table are associated (is purchase related to region?). The statistic is compared to the χ² distribution with the appropriate degrees of freedom.
Reading it and its limits#
A small p-value rejects the null (a real fit failure or association); the strength of an association is then summarized by Cramér’s V. The test needs adequate expected counts per cell and has low power on small samples — a non-significant result is weak evidence, not confirmation.
Theme: Statistical Inference & Power · All terminology
Hint
Mind map — connected ideas
Statistical Tests · Cramér’s V · Kolmogorov–Smirnov (KS) Test · Power Analysis · Kullback–Leibler (KL) Divergence · Data Drift
Hint
More in Statistical Inference & Power
A Priori Power Analysis · Clopper–Pearson Interval · Compromise Power Analysis · Confidence Intervals (CIs) · Effect Size (δ) · Hypothesis Testing · Kolmogorov–Smirnov (KS) Test · Minimum Detectable Lift (MDL) · P-Value (probability value) · Post Hoc Power Analysis · Power (1 – β) · Power Analysis · Sample size · Significance Level (α)
See also
Source article Adapted (context, re-expressed) in our own words from: Chi-square (χ²) Test (insightful-data-lab.com).