liveBook · Manning

Chi-square test

A chi-square test is a statistical hypothesis test that uses a chi-square-distributed statistic to evaluate hypotheses about categorical data, goodness of fit, or variance.

How 3 Manning books explain it

Statistics Slam Dunk

A chi-square test is a statistical test based on a chi-square-distributed statistic for assessing categorical-data relationships or distributional differences.

How it is used
Tests whether categorical variables such as prior rest and game outcomes are related.
How deep it goes
Defines independence hypotheses and p-value decisions, then demonstrates running chisq.test() on a contingency table.
Examples
Uses NBA days off versus wins and losses, survey sentiment versus marital status, political beliefs, and restaurant customer counts.
What you can do after
Apply it via base R’s chisq.test() to assess categorical relationships from a contingency table.

Read how Statistics Slam Dunk explains chi-square test →

Effective Data Analysis

A chi-square test is a statistical test that evaluates categorical data by comparing observed frequencies with frequencies expected under a specified hypothesis.

How it is used
Uses categorical comparisons when both independent and dependent variables are categorical.
How deep it goes
Explains test variants, observed-versus-expected frequencies, contingency tables, calculations, and pairwise follow-up comparisons.
Examples
Demonstrates recommender versions, countries, user clicks, expected-frequency tables, Python output, and an observed-versus-expected heatmap.
What you can do after
Apply it via SciPy to compare categorical frequencies and inspect expected counts, p-values, and cell-level differences.

Read how Effective Data Analysis explains chi-square test →

Statistics Every Programmer Needs

A chi-square test is a statistical hypothesis test that compares observed categorical counts with expected counts to assess whether their discrepancy is statistically significant.

How it is used
Tests whether observed leading-digit counts conform to Benford’s law for anomaly detection and statistical validation.
How deep it goes
Derives expected counts, the chi-square statistic, degrees of freedom, and p-value interpretation, while requiring sufficient records.
Examples
Uses leading digits in world population counts, with tabulated observed counts, expected counts, and category contributions.
What you can do after
Diagnose whether categorical counts significantly depart from an expected distribution using Python’s SciPy implementation.

Read how Statistics Every Programmer Needs explains chi-square test →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.