Real-world examples of chi-square tests in inferential statistics
Why start with examples of chi-square tests in inferential statistics?
If you hand most people a chi-square formula, their eyes glaze over. Hand them a table about vaccine uptake by age group, or customer response by ad type, and suddenly they care. That’s the power of good examples of chi-square tests in inferential statistics: they turn an abstract test into a decision-making tool.
At its core, a chi-square test compares observed counts (what you actually see) to expected counts (what you would see if there were no relationship or no difference). When those two sets of numbers are far enough apart, the chi-square statistic gets large, the p-value gets small, and you have evidence that something systematic is going on.
Below are several domains where you regularly see examples of chi-square tests in inferential statistics: public health, education, marketing, politics, manufacturing, and social science. Each one shows a slightly different angle on how this test is used in practice.
Public health: examples of chi-square tests in vaccine and disease studies
Public health is full of categorical data: infected vs. not infected, vaccinated vs. unvaccinated, hospitalized vs. not hospitalized. That’s why some of the best examples of chi-square tests in inferential statistics come from epidemiology.
Example 1: Vaccination status and COVID-19 hospitalization
Imagine a health department wants to know if COVID-19 vaccination status is associated with hospitalization during a winter surge. They collect data on a sample of 2,000 lab-confirmed COVID-19 cases:
- Rows: Vaccinated, Not vaccinated
- Columns: Hospitalized, Not hospitalized
The observed table might look something like this (numbers simplified for illustration):
| Hospitalized | Not hospitalized | Total | |
|---|---|---|---|
| Vaccinated | 120 | 1,180 | 1,300 |
| Not vaccinated | 220 | 480 | 700 |
| Total | 340 | 1,660 | 2,000 |
The chi-square test of independence asks: Is hospitalization independent of vaccination status, or is there a relationship?
If the expected counts under independence differ sharply from the observed counts, the chi-square statistic will be large and the p-value small. Analysts at agencies like the CDC regularly run these kinds of tests when evaluating vaccine effectiveness in observational data (see, for example, their COVID-19 data and statistics pages at cdc.gov).
Example 2: Mask use and infection status in a workplace
Suppose a large employer in 2024 wants to know whether regular mask use is associated with lower rates of respiratory infection among employees. They survey 1,000 workers:
- Mask use: Consistent vs. Inconsistent
- Infection status over the past 3 months: Infected vs. Not infected
Again, a chi-square test of independence is appropriate because both variables are categorical. The test provides evidence on whether infection rates differ beyond what would be expected by chance between the two mask-use groups.
These public health scenarios are classic examples of chi-square tests in inferential statistics: we’re not just describing percentages, we’re inferring whether a relationship likely exists in the broader population.
Education and social science: examples include achievement, discipline, and survey responses
Education and social science researchers love surveys and categories: grade levels, income brackets, political parties, Likert-scale responses. That creates a steady supply of examples of chi-square tests in inferential statistics.
Example 3: School discipline and race/ethnicity
Consider a large urban school district tracking whether students receive at least one suspension in a school year. The district wants to know if suspension rates differ by race/ethnicity.
- Rows: Racial/ethnic groups (e.g., White, Black, Hispanic, Asian, Other)
- Columns: Suspended at least once vs. Not suspended
A chi-square test of independence checks whether suspension status is independent of race/ethnicity. Unfortunately, in many districts, these tests show clear disparities. This kind of analysis often appears in civil rights and education equity reports from organizations and universities such as Harvard Graduate School of Education (gse.harvard.edu).
Example 4: Teaching method and pass/fail outcomes
Imagine a college statistics professor trying out a new active-learning teaching method in 2025. She randomly assigns sections to either the traditional lecture format or the new method.
- Teaching method: Traditional vs. Active learning
- Outcome: Pass vs. Fail
Here, a chi-square test of independence evaluates whether pass/fail rates differ between the two teaching methods. Because students were randomly assigned, this leans toward an experimental design, and the chi-square test becomes a way to infer whether the new method genuinely improves pass rates.
This is a textbook example of chi-square tests in inferential statistics: categorical treatment, categorical outcome, and a clear decision question.
Marketing and business: real examples from A/B tests and customer behavior
Modern marketing is data-obsessed, and many of the day-to-day decisions in 2024–2025 rely on chi-square tests under the hood.
Example 5: Email campaign A/B test
A marketing team wants to know whether a new subject line increases click-through rates. They run an A/B test on 50,000 subscribers:
- Version A: Old subject line
- Version B: New subject line
- Outcome: Clicked vs. Did not click
The data form a 2×2 contingency table. A chi-square test of independence assesses whether click behavior is independent of email version.
If the p-value is small and the new version has a higher click rate, the team has statistical evidence to roll out the new subject line. Many email and experimentation platforms quietly run this chi-square test for you in the background.
Example 6: Payment method and cart abandonment
An e-commerce company wants to know whether offering a new digital wallet option (e.g., a popular 2024 payment app) changes cart abandonment behavior.
- Payment options shown: Credit/debit only vs. Credit/debit + Digital wallet
- Outcome: Purchase completed vs. Cart abandoned
Again, this is a chi-square test of independence. The best examples of chi-square tests in inferential statistics in business look exactly like this: a clear behavioral outcome (buy vs. not buy) and an experimental or quasi-experimental condition.
Politics and polling: examples of chi-square tests in inferential statistics for voter behavior
Political scientists and pollsters rely heavily on categorical data: party ID, vote choice, demographic groups. That makes chi-square an everyday tool.
Example 7: Party identification and vote choice
Suppose a 2024 pre-election poll surveys 3,000 likely voters about their party identification and intended vote:
- Rows: Party ID (Democrat, Republican, Independent, Other)
- Columns: Vote choice (Candidate A, Candidate B, Third-party, Undecided)
A chi-square test of independence examines whether vote choice is independent of party ID. Spoiler: it usually isn’t. But the test quantifies how far the observed table is from the pattern you’d expect if there were no association at all.
This kind of analysis underpins many election-night discussions, where analysts talk about “vote choice by demographic group” and whether patterns differ from past elections.
Example 8: Support for a policy by age group
Imagine a country considering a new climate policy. A national poll asks respondents whether they support or oppose the policy, and records their age group:
- Age groups: 18–29, 30–44, 45–64, 65+
- Response: Support vs. Oppose vs. Don’t know
A chi-square test checks whether the distribution of responses is the same across age groups. If younger voters are much more likely to support the policy and older voters more likely to oppose, the chi-square statistic will reflect that divergence.
These are classic real examples of chi-square tests in inferential statistics used to interpret public opinion.
Manufacturing and quality control: goodness-of-fit examples
So far, we’ve looked at chi-square tests of independence. There’s another flavor: the chi-square goodness-of-fit test, which compares an observed distribution to a theoretical or expected one.
Example 9: Defect types in a production line
A factory tracks defects on a new production line for 10,000 units. Defects fall into four categories:
- Surface flaw
- Alignment issue
- Electrical fault
- Packaging damage
Management believes, based on historical data, that these types should occur in proportions of 40%, 30%, 20%, and 10%, respectively. After the line upgrade, they observe a different pattern.
A chi-square goodness-of-fit test compares the observed counts in each defect category to the expected counts under the 40–30–20–10 split. If the test indicates a statistically significant difference, engineers may investigate whether the new process introduced a specific type of defect.
Example 10: Survey responses vs. a uniform distribution
Researchers sometimes want to know whether responses are evenly spread across categories or skewed. For example, a social scientist running a survey on a controversial topic might offer five options:
- Strongly disagree
- Disagree
- Neutral
- Agree
- Strongly agree
If they hypothesize that, in the absence of strong opinions, responses would be roughly uniform across categories, they can use a chi-square goodness-of-fit test to compare the observed response distribution with a uniform distribution.
This is another clean example of chi-square tests in inferential statistics: one categorical variable, a theoretical distribution, and a question about whether reality matches expectation.
How chi-square tests support inferential thinking
Across all these domains, the pattern is the same:
- Data: Categorical variables summarized in counts.
- Null hypothesis: No association (for independence tests) or a specific expected distribution (for goodness-of-fit tests).
- Test statistic: A single number measuring how far observed counts are from expected counts.
- Inference: A p-value that tells you how surprising your data would be if the null hypothesis were true.
When you see tables like “disease by exposure status,” “purchase by ad type,” or “vote choice by demographic group,” you’re staring at potential examples of chi-square tests in inferential statistics. The test is not flashy, but it’s reliable, well-understood, and widely taught in introductory statistics courses at universities such as Harvard, MIT, and state universities across the U.S.
For a deeper theoretical treatment and assumptions (like minimum expected cell counts and independence of observations), many instructors point students to open statistics textbooks hosted by universities and organizations such as UCLA Statistical Consulting Group or NCSSM.
Common pitfalls when using chi-square tests
Real examples of chi-square tests in inferential statistics are only as good as the data and design behind them. A few recurring issues:
- Small expected counts: If many cells have expected counts below about 5, the chi-square approximation can get shaky. Alternatives like Fisher’s exact test may be better for very small samples.
- Non-independent observations: If the same person appears in the table more than once (e.g., repeated measures) without adjustment, the test’s assumptions are violated.
- Post-hoc fishing: Running a chi-square test on every possible cross-tab in a giant dataset almost guarantees you’ll find “significant” results by chance. Pre-registering hypotheses or adjusting for multiple testing can help.
- Overinterpreting p-values: A small p-value does not tell you the effect size or practical importance—only that the pattern is unlikely under the null model.
Understanding these limitations keeps your use of chi-square grounded in reality rather than wishful thinking.
FAQ: examples of chi-square tests in inferential statistics
Q1. What is a simple real-world example of a chi-square test?
A straightforward example of a chi-square test is comparing pass/fail rates for students taught with two different teaching methods. You record how many students pass and fail in each group, arrange the counts in a 2×2 table, and run a chi-square test of independence to see if pass rates differ by method.
Q2. When should I use a chi-square test instead of a t-test?
Use a chi-square test when your data are counts in categories (e.g., yes/no, support/oppose, type of defect). Use a t-test when you’re comparing means of a numeric variable (e.g., average test scores, average blood pressure) between two groups.
Q3. Are chi-square tests used in medical research today?
Yes. Medical and public health researchers still use chi-square tests extensively to analyze contingency tables, especially in observational studies and clinical trials where outcomes are categorical (e.g., improved/not improved, adverse event/no adverse event). You can see many published examples in resources from the National Institutes of Health at nih.gov and clinical trials literature.
Q4. Can chi-square tests handle more than two categories per variable?
Absolutely. Some of the best examples of chi-square tests in inferential statistics involve many categories, such as multiple age groups crossed with several response options on a survey. As long as you meet the assumptions (especially reasonable expected counts), the test extends naturally to larger tables.
Q5. What’s an example of misusing a chi-square test?
A classic misuse is applying a chi-square test to percentages or continuous data that have been arbitrarily binned into categories, losing a lot of information in the process. Another example is using chi-square on repeated observations from the same individuals without accounting for the lack of independence.
If you keep these real examples of chi-square tests in inferential statistics in mind, the test stops being just a formula and becomes what it actually is: a workhorse tool for turning categorical data into evidence-based decisions.
Related Topics
Real-world examples of chi-square tests in inferential statistics
Real-world examples of correlation coefficients in inferential statistics
Real-world examples of hypothesis testing examples in inferential statistics
Real-world examples of effect size in inferential statistics
Real-world examples of p-values in inferential statistics
Real-world examples of ANOVA in inferential statistics
Explore More Inferential Statistics Examples
Discover more examples and insights in this category.
View All Inferential Statistics Examples