The best examples of chi-square test examples for contingency tables
Before any formulas, it helps to see how chi-square tests show up in daily work. Here are situations where analysts routinely use contingency tables:
- Epidemiologists comparing smoking status by lung disease outcome.
- School districts comparing teaching method by pass/fail rates.
- Marketers comparing ad version by click/no-click behavior.
- Political analysts comparing age group by party preference.
All of these are examples of chi-square test examples for contingency tables: we have two categorical variables, we count how many observations fall into each combination of categories, and we test whether the pattern of counts suggests a relationship.
Example of a 2x2 contingency table: vaccine uptake by region
Let’s start small with a classic 2x2 table, because many of the best examples use this format.
Imagine a public health department studying COVID-19 booster uptake in 2024 across two regions: Urban and Rural. They sample 800 adults and record whether each person received a booster.
| Booster | No Booster | Total | |
|---|---|---|---|
| Urban | 260 | 140 | 400 |
| Rural | 210 | 190 | 400 |
| Total | 470 | 330 | 800 |
We want to know: Is booster uptake independent of region?
Under the null hypothesis of independence, the expected count in each cell is:
\[ E_{ij} = \frac{(\text{row total}) (\text{column total})}{\text{grand total}} \]
For Urban & Booster:
\[ E_{Urban,Booster} = \frac{400 \times 470}{800} = 235 \]
Observed is 260; expected is 235. We compute the chi-square statistic as:
\[ \chi^2 = \sum \frac{(O - E)^2}{E} \]
If the resulting \(\chi^2\) value is large enough (with 1 degree of freedom here), the p-value will be small, and we reject independence: booster status appears related to region.
This kind of 2x2 layout is one of the most common examples of chi-square test examples for contingency tables in public health and policy analysis. For background on how real surveillance data are collected, the CDC’s data pages are a good reference: https://www.cdc.gov/datastatistics/index.html
Multi-category example: exercise frequency by gender
Now let’s move beyond 2x2. Suppose a researcher surveys 600 adults about exercise frequency and gender. Categories:
- Gender: Male, Female, Nonbinary
- Exercise frequency: Rarely, Sometimes, Often
The contingency table might look like this:
| Gender | Rarely | Sometimes | Often | Total |
|---|---|---|---|---|
| Male | 60 | 80 | 60 | 200 |
| Female | 40 | 100 | 60 | 200 |
| Nonbinary | 30 | 50 | 120 | 200 |
| Total | 130 | 230 | 240 | 600 |
Question: Is exercise frequency associated with gender?
This is a textbook example of a chi-square test for a 3x3 contingency table. Degrees of freedom are:
\[ (r - 1)(c - 1) = (3 - 1)(3 - 1) = 4 \]
If the chi-square statistic is large relative to this distribution, we conclude that exercise patterns differ by gender in a way that’s unlikely to be due to random sampling variation.
The interpretation is not “which gender is better” but whether the distribution of Rarely/Sometimes/Often is different across gender categories.
Education research example: teaching method and pass rates
Education is full of examples of chi-square test examples for contingency tables. Picture a district testing two teaching methods for a standardized math exam in 2025:
- Method A: Traditional lecture
- Method B: Interactive, tech-supported instruction
They track whether students pass or fail the end-of-year exam.
| Teaching Method | Pass | Fail | Total |
|---|---|---|---|
| A | 180 | 70 | 250 |
| B | 220 | 30 | 250 |
| Total | 400 | 100 | 500 |
Hypotheses:
- Null (H₀): Teaching method and pass/fail outcome are independent.
- Alternative (H₁): They are not independent.
You compute expected counts, then \(\chi^2\). If the p-value is small, you have evidence that the interactive method is associated with higher pass rates.
This is the sort of example of chi-square test that shows up in education policy debates: are new instructional strategies actually changing outcomes, or are apparent differences just random?
For broader context on education research methods, the National Center for Education Statistics (NCES) is a useful resource: https://nces.ed.gov
Marketing example: ad variant and click-through behavior
Digital marketing teams constantly run A/B tests that generate contingency tables. Imagine an online retailer in 2024 comparing three ad versions for a campaign:
- Ad 1: Price-focused
- Ad 2: Sustainability-focused
- Ad 3: Lifestyle-focused
Users either click or don’t click the ad.
| Ad Version | Click | No Click | Total |
|---|---|---|---|
| 1 | 310 | 1,690 | 2,000 |
| 2 | 420 | 1,580 | 2,000 |
| 3 | 360 | 1,640 | 2,000 |
| Total | 1,090 | 4,910 | 6,000 |
The question: Is click behavior independent of ad version?
This is another example of chi-square test examples for contingency tables where the outcome is binary but the explanatory variable has more than two categories. If the chi-square test rejects independence, the marketing team can justify reallocating budget toward the ad with the strongest click-through rate, backed by statistical evidence rather than gut feeling.
Health behavior example: smoking status and chronic disease
Health research provides some of the best examples because the stakes are high and the data sets are large. Consider a study of 1,200 adults categorized by smoking status and presence of chronic respiratory disease.
- Smoking status: Never, Former, Current
- Disease status: Disease, No Disease
| Smoking Status | Disease | No Disease | Total |
|---|---|---|---|
| Never | 40 | 460 | 500 |
| Former | 60 | 240 | 300 |
| Current | 140 | 260 | 400 |
| Total | 240 | 960 | 1,200 |
Here, the chi-square test checks whether the distribution of disease vs. no disease is the same across smoking groups. A large chi-square statistic with a small p-value supports the idea that smoking status and disease are associated.
This mirrors the kind of analysis used in epidemiology and public health surveillance. Agencies like the National Institutes of Health (NIH) publish related research and methodology discussions: https://www.nih.gov
Technology adoption example: age group and smartphone OS
As of 2024–2025, smartphone operating system preferences are still a favorite topic for consumer behavior studies. Suppose a survey records age group and primary smartphone OS (iOS, Android, Other) for 900 users.
- Age groups: 18–29, 30–49, 50+
| Age Group | iOS | Android | Other | Total |
|---|---|---|---|---|
| 18–29 | 170 | 110 | 20 | 300 |
| 30–49 | 150 | 130 | 20 | 300 |
| 50+ | 90 | 200 | 10 | 300 |
| Total | 410 | 440 | 50 | 900 |
Again, this is a classic example of chi-square test examples for contingency tables: we test whether OS preference is independent of age group. If the test shows a strong association, tech companies and app developers can justify tailoring features or marketing messages to specific age segments.
Education equity example: discipline outcomes by race/ethnicity
Researchers studying equity in schools often rely on contingency tables. Consider a district tracking discipline outcome (No Action, Warning, Suspension) by race/ethnicity. A simplified table for 1,000 incidents might look like:
| Race/Ethnicity | No Action | Warning | Suspension | Total |
|---|---|---|---|---|
| Group A | 150 | 140 | 60 | 350 |
| Group B | 120 | 160 | 70 | 350 |
| Group C | 60 | 90 | 150 | 300 |
| Total | 330 | 390 | 280 | 1,000 |
The chi-square test investigates whether discipline outcomes are independent of race/ethnicity. A significant result would suggest disparities that merit deeper investigation, policy review, and possibly more granular modeling.
This kind of application illustrates why examples of chi-square test examples for contingency tables are not just academic. They feed directly into debates about fairness and policy design.
How to read and interpret these chi-square examples
Across all these real examples, the workflow is the same:
- Set up the contingency table. Rows and columns represent categories of two variables.
- Compute expected counts assuming independence.
- Calculate the chi-square statistic using \( \sum (O - E)^2 / E \).
- Find the p-value using the chi-square distribution with \((r-1)(c-1)\) degrees of freedom.
- Make a decision: if p is small (often below 0.05), treat the data as evidence that the variables are associated.
What changes from one example of chi-square test to another is the context, not the core logic. Whether you’re studying click-through rates, disease prevalence, or education outcomes, the interpretation always comes back to: Does the pattern of counts suggest a real association, or can it reasonably be attributed to random variation?
Common pitfalls when using chi-square with contingency tables
When you study examples of chi-square test examples for contingency tables, it’s easy to focus only on the final p-value. But there are recurring issues to watch for:
- Small expected counts. If many expected cell counts are below about 5, the chi-square approximation can break down. Alternatives like Fisher’s exact test or combining categories may be better.
- Causality confusion. A significant chi-square test shows association, not cause and effect. The smoking–disease example hints at causality, but that conclusion relies on biology, longitudinal data, and prior research, not just the contingency table.
- Multiple testing. In large projects, analysts may run many chi-square tests across different subgroups. Without correcting for multiple comparisons, some “significant” results will appear just by chance.
- Ignoring effect size. A large sample can make tiny differences statistically significant. It’s helpful to pair chi-square with measures like Cramer’s V to describe the strength of association.
Looking at real examples—including the best examples from public health, marketing, and education—helps you see these issues in context.
FAQ: short answers built around real examples
Q1. Can you give a simple example of a chi-square test for a contingency table?
Yes. The vaccine uptake by region table (Urban vs. Rural crossed with Booster vs. No Booster) is a straightforward 2x2 example of a chi-square test. You compute expected counts under independence, calculate \(\chi^2\), and check whether the observed difference in booster rates is larger than you’d expect from random sampling.
Q2. What kinds of real examples include chi-square tests with more than two categories?
The exercise frequency by gender example and the smartphone OS by age group example both use three-by-three tables. In each case, the chi-square test asks whether the distribution across categories (exercise levels or OS choices) is the same for all groups, or whether some groups lean more heavily toward certain categories.
Q3. How are chi-square contingency table tests used in health research?
Health researchers use these tests to compare disease status across exposure categories—like smoking status, vaccination status, or treatment group. The chronic respiratory disease by smoking status table is typical. Agencies such as the CDC and NIH regularly publish reports where contingency tables and chi-square tests appear in the methods sections.
Q4. Are chi-square test examples for contingency tables only for 2x2 layouts?
No. While 2x2 layouts (like pass/fail by teaching method) are common, many of the best examples of chi-square test examples for contingency tables involve larger tables: multiple age groups, several treatment arms, or multiple outcome categories.
Q5. Where can I study more worked examples of chi-square tests?
University statistics departments often post lecture notes and problem sets online. For instance, many .edu sites host open course materials for introductory statistics that walk through step-by-step chi-square calculations for contingency tables. Combining those with real data summaries from sources like NCES, CDC, and NIH will give you a strong library of practice problems.
The bottom line: once you understand a few concrete examples of chi-square test examples for contingency tables—from vaccines to education to marketing—you’ve basically learned the pattern. After that, new problems are just different labels on the rows and columns.
Related Topics
The best examples of chi-square test examples in healthcare studies
Real-world examples of chi-square test for independence
The best examples of chi-square test examples for contingency tables
The best examples of chi-square test examples in genetics
Chi-Square Test Examples in Market Research: An In-Depth Analysis
Explore More Chi-Square Test Examples
Discover more examples and insights in this category.
View All Chi-Square Test Examples