🧮  Chi-square (χ²) Test

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:

\[\chi^2 = \sum_{i} \frac{(O_i - E_i)^2}{E_i}.\]

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



See also

Source article Adapted (context, re-expressed) in our own words from: Chi-square (χ²) Test (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: beginner