Real‑world examples of chi-square test for independence examples

If you’re looking for clear, real‑world examples of chi-square test for independence examples, you’re in the right place. This test shows up everywhere: in medicine, marketing, education, politics, and even sports analytics. Whenever you have two categorical variables and you want to know whether they’re related or just randomly associated, the chi-square test for independence is the workhorse. In this guide, we’ll walk through some of the best examples of chi-square test for independence examples using actual research-style scenarios: smoking and lung disease, vaccine status and infection, gender and major, ad type and click‑through, and more. Instead of just throwing formulas at you, we’ll focus on how analysts frame the question, set up the contingency table, and interpret the p‑value in context. By the end, you’ll recognize when this test fits, how to explain the results to non‑statisticians, and how real examples from 2024–2025 data and trends map directly to the theory you learn in class.
Written by
Jamie
Published

Why start with real examples of chi-square test for independence

Stat textbooks love formulas. Practitioners love tables. The bridge between them is concrete, real examples of chi-square test for independence examples that look like the data you’d actually see in a spreadsheet.

The chi-square test for independence is used when:

  • You have two categorical variables (like “Smoker vs. Non‑smoker” and “Has COPD vs. No COPD").
  • You want to know whether there is a statistically significant association between them.
  • Your data are summarized in a contingency table (also called a cross‑tab).

Let’s walk through several of the best examples, from public health to politics to tech, and keep the math light but honest.


Health and medicine: smoking and chronic disease (classic example of chi-square test for independence)

Public health research is full of examples of chi-square test for independence examples because so many outcomes are categorical: disease vs. no disease, vaccinated vs. not vaccinated, hospitalized vs. not.

Imagine a local health department studying whether smoking status is associated with chronic obstructive pulmonary disease (COPD) among adults over 40. They collect a sample of 800 people and classify them as:

  • Smoker vs. Non‑smoker
  • COPD vs. No COPD

Their contingency table might look like this:

COPD No COPD Total
Smoker 120 180 300
Non‑smoker 40 460 500
Total 160 640 800

The null hypothesis: smoking status and COPD are independent (no association).
The alternative: they are not independent (there is an association).

The chi-square test for independence compares the observed counts in each cell to the expected counts if smoking and COPD were unrelated. If the differences are large enough, the chi-square statistic is large and the p‑value is small.

Here, the proportion of COPD among smokers (120/300 = 40%) is much higher than among non‑smokers (40/500 = 8%). When you run the chi-square test, you’d get a very small p‑value (far below 0.05), so you reject independence and conclude there is a statistically significant association.

For real public health data on smoking and disease, the CDC provides many tables and reports that are analyzed with chi-square tests in practice:

  • https://www.cdc.gov/tobacco/data_statistics/index.htm

Another timely example of chi-square test for independence examples comes from vaccine effectiveness monitoring. Suppose a hospital system in 2024 tracks whether patients are vaccinated for a respiratory virus and whether they test positive during flu season.

Variables:

  • Vaccination status: Vaccinated vs. Not vaccinated
  • Test result: Positive vs. Negative

Sample data from a single month:

Positive Negative Total
Vaccinated 70 930 1000
Not vaccinated 180 820 1000
Total 250 1750 2000

If vaccination and infection status were independent, the proportion positive should be similar in both groups. Instead, the vaccinated group has 7% positive, while the unvaccinated group has 18%.

Running a chi-square test here typically yields a small p‑value, indicating that infection status is not independent of vaccination status. In plain English: infection rates differ by vaccination status in a way that’s unlikely to be due to random sampling.

Analyses like this mirror what you see in real epidemiologic surveillance, such as vaccine effectiveness studies from the NIH or CDC:

  • https://www.nih.gov/
  • https://www.cdc.gov/vaccines/index.html

This is one of the best examples of chi-square test for independence examples for explaining the idea to health‑science students: two categories in, a clear public‑health story out.


Education: gender and college major (social science favorite)

Social scientists constantly need examples of chi-square test for independence examples to study group differences. A classic case: is gender associated with choice of college major?

Suppose a university in 2025 samples 1,200 undergraduates and records:

  • Gender: Man, Woman (we’ll keep it binary here for the math, but real analyses often include additional categories).
  • Major type: STEM vs. Non‑STEM.

Data might look like:

STEM Non‑STEM Total
Men 260 140 400
Women 220 580 800
Total 480 720 1200

The null hypothesis says gender and major type are independent. Expected counts are based on overall STEM vs. Non‑STEM proportions applied to each gender.

Here, 65% of men in the sample are in STEM (260/400), but only 27.5% of women are (220/800). A chi-square test will almost certainly flag a strong association with a very low p‑value.

This is a textbook example of chi-square test for independence examples because:

  • Both variables are clearly categorical.
  • The result is easy to explain: the distribution of majors differs by gender.
  • It connects directly to policy questions about representation in STEM.

For real data and research on gender and STEM participation, check out analyses from institutions like Harvard and other universities:

  • https://www.harvard.edu/

Marketing analytics: ad type and click‑through behavior

If you work in marketing or product analytics, you’ll run into real examples of chi-square test for independence examples almost weekly.

Picture a digital ad A/B test in 2024. A company runs two versions of a banner ad:

  • Ad A: static image
  • Ad B: short animation

They record whether users click the ad or don’t click. After a few days, the data look like this:

Clicked Not clicked Total
Ad A 420 8580 9000
Ad B 560 8440 9000
Total 980 17,020 18,000

The click‑through rate (CTR) is 4.67% for Ad A and 6.22% for Ad B.

Is this difference just noise, or is ad performance truly associated with ad type? That’s exactly what the chi-square test for independence checks in this two‑by‑two table.

In many A/B testing dashboards, the underlying engine is effectively running a chi-square test (or an equivalent test like a two‑proportion z‑test) behind the scenes. This is one of the best examples of chi-square test for independence examples because it connects directly to revenue decisions: which creative to scale, which to kill.


Tech and UX: device type and feature usage

Product teams also need examples of chi-square test for independence examples when they ask, “Are users on different platforms behaving differently?”

Suppose a streaming app in 2025 wants to know if device type is associated with whether users enable offline downloads.

Variables:

  • Device: Phone vs. Tablet vs. TV app
  • Offline downloads: Enabled vs. Not enabled

Sample data:

Device Enabled Not enabled Total
Phone 520 1480 2000
Tablet 260 740 1000
TV app 80 920 1000
Total 860 3140 4000

Here, 26% of phone users enable downloads, 26% of tablet users, but only 8% of TV‑app users do. A chi-square test for independence across this 3×2 table checks whether the pattern of enabled vs. not enabled differs by device.

The result informs design and product decisions:

  • If TV users rarely enable downloads, maybe the UI needs to highlight it more.
  • Or maybe the feature isn’t relevant on that platform.

Again, this is a real example of chi-square test for independence examples where the conclusion directly shapes product strategy.


Politics and polling: party affiliation and policy support

Pollsters often need examples of chi-square test for independence examples when explaining why certain groups support or oppose a policy.

Imagine a 2024 national poll asking about support for a new environmental regulation.

Variables:

  • Party affiliation: Democrat, Republican, Independent
  • Policy stance: Support vs. Oppose

Sample data from 1,500 respondents:

Party Support Oppose Total
Democrat 520 180 700
Republican 160 340 500
Independent 140 160 300
Total 820 680 1500

The question: Is policy stance independent of party affiliation?

Chi-square compares observed counts to expected counts under independence. If the test is significant, you can say something like:

“Support for the regulation varies by party, with Democrats more likely to support and Republicans more likely to oppose.”

This is one of the best examples of chi-square test for independence examples for communication, because journalists and the public intuitively understand what it means when support patterns differ across parties.


Sports analytics: home vs. away and win/loss

Sports analytics offers surprisingly clean examples of chi-square test for independence examples. Consider a basketball league tracking whether home vs. away games are associated with game outcome.

Variables:

  • Location: Home vs. Away
  • Result: Win vs. Loss

Over a season, a team’s record might look like:

Win Loss Total
Home 30 11 41
Away 18 23 41
Total 48 34 82

Is the probability of winning independent of location? The chi-square test checks whether the distribution of wins and losses is the same at home and away.

If the p‑value is small, you conclude that home‑court advantage exists for this team in this season. Analysts can then explore why: crowd noise, travel fatigue, or officiating patterns.

Sports teams and leagues often run exactly this type of test as part of their routine analytics.


How to recognize when to use the chi-square test for independence

After seeing these real examples of chi-square test for independence examples across fields, a pattern emerges. You should think about this test when:

  • Both variables are categorical (nominal or sometimes ordinal, treated as categories).
  • You can organize data into a contingency table (2×2, 3×2, 4×3, etc.).
  • You want to check whether the distribution of one variable differs across categories of the other.

Some quick diagnostic questions:

  • Are you comparing proportions across groups?
  • Do your cells represent counts of people, events, or items, not means or continuous scores?
  • Would a bar chart of percentages by group make sense here?

If yes, you’re probably in chi-square territory.

For students and analysts, keeping a mental library of examples of chi-square test for independence examples—like smoking vs. COPD, gender vs. major, ad type vs. clicks—makes it much easier to recognize the right tool in new situations.


Common mistakes when working with chi-square independence tests

Even with the best examples of chi-square test for independence examples, there are a few traps to watch for:

1. Treating continuous data as categorical without a good reason
If your outcome is continuous (e.g., income, blood pressure), you probably want a t‑test, ANOVA, or regression, not chi-square—unless you’ve thoughtfully binned the data into categories.

2. Ignoring small expected counts
Chi-square assumes expected counts in each cell aren’t too small (a common rule of thumb is at least 5). If your table has sparse cells, consider combining categories or using Fisher’s exact test.

3. Confusing association with causation
A significant chi-square test shows an association, not a cause‑and‑effect relationship. The smoking and COPD example of chi-square test for independence examples lines up with a strong causal story, but that’s because of decades of additional evidence, not just one test.

4. Over‑interpreting p‑values without effect sizes
With huge samples (think millions of ad impressions), tiny differences can be statistically significant. It’s better to pair chi-square with effect size measures like Cramér’s V to gauge how strong the association is.

For a more technical treatment, many university stats departments (e.g., via .edu resources) provide detailed notes on chi-square assumptions and effect sizes.


FAQ: examples of chi-square test for independence examples

Q1. What are some everyday examples of chi-square test for independence examples?
Everyday data scenarios include: store location vs. product preference, email subject line vs. open rate, class format (online vs. in‑person) vs. pass/fail, and device type vs. subscription renewal. Any time you’re comparing categories vs. categories, you’re in the ballpark.

Q2. Can you give a simple example of chi-square test for independence with a 2×2 table?
The smoking vs. COPD table is a classic simple example of chi-square test for independence. Two groups (smoker/non‑smoker), two outcomes (COPD/no COPD). You test whether the proportion with COPD is the same in both groups. If not, the variables are not independent.

Q3. How are chi-square independence tests used in medical research?
Medical studies often compare treatment vs. control groups on categorical outcomes: improved/not improved, side‑effects/no side‑effects, hospitalized/not hospitalized. For instance, comparing vaccinated vs. unvaccinated infection rates is one of the best examples of chi-square test for independence examples in epidemiology.

Q4. Do I always need large samples for this test?
Larger samples help, but what matters most is that expected counts in each cell aren’t too small. With very small samples or sparse tables, Fisher’s exact test is safer. Many statistical software packages will flag when chi-square assumptions look shaky.

Q5. Where can I see real published examples of chi-square test for independence?
Look at open‑access articles from public health, education, or psychology journals. Many use chi-square to compare groups on categorical outcomes. Government and academic sites like the CDC, NIH, and major universities often share reports where chi-square tests are used under the hood.


If you keep these real examples of chi-square test for independence examples in mind, the method stops feeling abstract and starts looking like what it really is: a simple, reliable way to ask whether two categorical variables in your data are related in a meaningful way.

Explore More Hypothesis Testing Examples

Discover more examples and insights in this category.

View All Hypothesis Testing Examples