📚 College Credit Guide ✓ UPI Study 🕐 7 min read

What Are Tests Of Independence And Contingency Tables?

This article explains how contingency tables organize categorical data and how a chi-square test of independence checks whether two variables are associated.

US
UPI Study Team Member
📅 September 11, 2026
📖 7 min read
US
About the Author
The UPI Study team works directly with students on credit transfer, degree planning, and course selection. We've helped thousands of students figure out what counts toward their degree and how to finish faster without paying more than they have to. This post is written the way we'd explain it to you directly.
🦉

Tests of independence and contingency tables help you answer one simple question: do 2 categorical variables seem related, or do they act like strangers? A contingency table lays out observed counts in rows and columns, and a chi-square test of independence checks whether the pattern looks different from what random chance would give. That sounds dry, but the idea shows up everywhere in principles of statistics. Think of 2 variables like major and part-time status, or age group and voting choice. The table gives you the counts. The test tells you whether those counts look normal or weird enough to matter. The main job is not memorizing a formula. It is learning what the table means, how expected counts work, and how to read a p-value without getting lost. Once you know those pieces, you can handle homework problems, exam questions, and the kind of datasets that make sense in a college credit statistics class. A lot of students trip on one small thing: this test looks at association, not cause. If smoking status and disease status are linked, the test says they are associated. It does not say one causes the other. That line matters, and professors care about it a lot.

Principles of Statistics
College credit · ACE & NCCRS reviewed · self-paced
View course
Close-up of a colorful business chart placed on a table with documents highlighting trends — UPI Study

What Do Contingency Tables Show?

A contingency table shows how 2 categorical variables line up by placing observed counts in rows and columns, so you can compare groups without guessing. A 2×3 table, for example, might cross gender with drink choice, or class year with commute type.

Each cell holds a raw count, not a percentage, and that matters because the chi-square test starts with counts. If 18 students fall in one cell and 42 in another, the table records those frequencies before any math starts. The row totals and column totals, called marginal totals, show the full breakdown for each category.

Simple structure: The table gives you a clean snapshot of the data: 4 cells in a 2×2 table, 6 cells in a 2×3 table, or more if you have extra categories. That setup helps you compare observed frequencies across groups without mixing the numbers together.

The real question behind the table is association. If the distributions look similar across rows or columns, the variables may act independently. If one row leans hard toward one column, the pattern starts to look linked, and that is what the test tries to measure.

Raw counts, marginal totals, and the grand total all matter. A table with 200 people can still show no association if each row splits about the same way, while a smaller table can look lopsided fast. That is why percentages alone can mislead if you do not keep the count scale in view.

For a Principles of Statistics class, this is one of those topics that looks small on paper and shows up in almost every unit. A 2×2 table can already tell a strong story, and a 4×3 table can get messy fast if you skip the structure.

How Do You State Independence Hypotheses?

The null hypothesis for a chi-square test of independence says the 2 categorical variables are independent, while the alternative says they are associated. That is the whole fight: H0 claims no pattern, and H1 claims a pattern that is too strong to blame on chance.

A real question becomes testable when you turn it into categories with clear labels. Suppose you want to know whether class format and passing rate are related. You can code class format as online or in-person, then pass/fail as 2 categories. Now you have a 2×2 table instead of a vague opinion.

Reality check: The test does not prove causation, even if the p-value comes out tiny at 0.01. Association means the variables move together in the data; cause means one makes the other happen, and this test does not reach that far.

That difference matters a lot in a principles of statistics course, because students love to overread results. A survey can show that sleep hours and exam score are associated, but the test does not tell you whether better sleep caused the higher score, whether stronger students slept more, or whether some third thing sat behind both.

Write the hypotheses in words and symbols if your teacher wants both. H0: the variables are independent. H1: the variables are associated. Keep the wording tight, because “related” can sound casual and “independent” has a precise meaning in 2-way tables.

For homework, I would write the categorical names first, then the hypotheses second. That order keeps the problem grounded and cuts down on sloppy wording, which costs points fast on a 10-point quiz.

Which Expected Counts Must You Check?

Expected counts tell you what each cell should look like if the 2 variables really were independent, and you compute them with one exact rule: (row total × column total) ÷ grand total. A 40-by-60 split in a table with 200 people can produce a very different expected value from the raw count, and that difference is the whole point of the chi-square test. If the expected counts stay decent, the test has a stable base; if they get tiny, the result gets shaky fast.

Worth knowing: The usual rule of thumb says expected counts should be at least 5 in each cell, and many instructors treat that as the line you should not cross. When a cell drops below 5, the chi-square approximation can wobble, especially in a 2×2 table with a small sample like 20 or 30.

That rule feels picky, but it saves you from trusting a test that rests on weak math. I like that part of the method; it forces you to look at the table before you sprint to a p-value.

A good habit is to compare observed and expected counts side by side. If the observed count is 18 and the expected count is 9, that cell pulls hard on the test statistic. If the observed count sits near the expected count, that cell barely moves the result.

In an online course, this is the exact mechanics section students tend to miss, because the formula looks easy and the judgment call feels dull. It is not dull. It decides whether the test even belongs on the page.

Principles Of Statistics UPI Study Course

Learn Principles Of Statistics Online for College Credit

This is one topic inside the full Principles Of Statistics course on UPI Study — a self-paced, online class that earns real college credit. Credits are ACE and NCCRS evaluated and transfer to partner colleges across the US and Canada. Courses start at $250 with no deadlines and lifetime access.

Explore Principles Of Statistics →

How Do You Read The Chi-Square Result?

The chi-square statistic measures how far the observed counts sit from the expected counts, and bigger values mean a bigger mismatch with independence. If the table lines up closely, the statistic stays small; if several cells miss by a lot, the statistic grows fast.

That number alone does not finish the job. You still need the p-value, which tells you how unusual a chi-square statistic that large would be if H0 were true. A common cutoff is 0.05, and some courses also use 0.01 when they want a stricter call.

If p < 0.05, you reject the null hypothesis and say the data give evidence of association. If p ≥ 0.05, you fail to reject H0, which means you do not have strong evidence against independence. That does not prove the variables are independent; it only means the sample did not show enough push to reject that idea.

Bottom line: A small p-value does not mean “important” in a real-world sense, and a large p-value does not mean “nothing happened.” It only tells you how hard the data fought against the independence claim.

One thing I wish more students heard early: the chi-square test works with category counts, not averages or scores like 82 or 91. If you have one variable measured on a 1-to-5 scale, you can still test it after grouping, but you need clean categories first.

In a principles of statistics course, the best answers name the decision rule, the p-value, and the context together. That combination shows you know what the number means instead of just copying a calculator output.

What Steps Solve A Contingency Table Test?

A full chi-square test of independence follows the same path every time: identify the variables, build the table, check the 5-count rule, and then read the p-value against 0.05. If you keep the order straight, the problem feels much less messy on a timed quiz or exam.

  1. Name the 2 categorical variables and write the contingency table with the observed counts.
  2. State H0 and H1 in words; H0 says independent, and H1 says associated.
  3. Check the expected counts with (row total × column total) ÷ grand total, and watch for any cell below 5.
  4. Compute the chi-square statistic and compare it to the right distribution for the table size, like a 2×2 or 3×4 setup.
  5. Use the p-value and the 0.05 cutoff to decide whether to reject independence, then write the conclusion in context.

How Do Tests Of Independence And Contingency Tables Help In Statistics?

Tests of independence and contingency tables give you a clean way to study two categorical variables without pretending the data are continuous. A 3×2 table can show patterns that a single average would hide, and that matters in real classes, real surveys, and real reports.

The best part is the logic. You start with observed counts, compare them to expected counts, and then let the chi-square statistic show whether the gap looks small or hard to ignore. That same framework shows up in health studies, opinion polls, and course data with 100 or 500 records.

A downside? The method only works well when the categories make sense and the expected counts stay big enough. If you force messy labels into a table, the test can spit out a number that looks official but does not say much.

Principles of Statistics covers this topic in a way that matches what students see on homework, exams, and transfer-ready math courses. UPI Study offers 90+ college-level courses, all ACE and NCCRS approved, and that matters because those reviews help colleges evaluate non-traditional credit. The platform charges $250 per course or $99 per month for unlimited access, and it runs fully self-paced with no deadlines. Credits transfer to partner US and Canadian colleges, so students can study online and still build transferable credit in a format that fits busy schedules.

Principles of Statistics also fits learners who want ace nccrs credit without sitting in a fixed 16-week term. UPI Study keeps the structure simple, and that simplicity pairs well with statistics topics that already ask you to track counts, thresholds, and p-values.

Frequently Asked Questions about Contingency Tables

Final Thoughts on Contingency Tables

Contingency tables give you the shape of the data, and the chi-square test tells you whether that shape looks too uneven to blame on chance. That is the whole game. You count, compare, test, and then say what the numbers mean in plain language. The hardest part is often not the formula. It is the habit of reading carefully. You need to name the variables, write the hypotheses, check the expected counts, and decide whether the p-value clears the line at 0.05. Skip one step, and the answer can wobble even if the calculator output looks neat. I also think this topic rewards slow, clean thinking more than raw speed. Students who rush often confuse association with cause, or they stare at a table of 24 cells and forget that each cell still follows the same basic logic as a 2×2 table. The method does not change just because the numbers get bigger. If you keep practicing with real tables, the process starts to feel familiar fast. Build the table, test it, read the result, and say the conclusion in context. That is the move that turns a stack of counts into an actual statistical answer. On your next problem, write the hypotheses first and the conclusion last. That one habit saves more points than most students expect.

How UPI Study credits actually work

Ready to Earn College Credit?

ACE & NCCRS approved · Self-paced · Transfer to colleges · $250/course or $99/month

More on Principles Of Statistics
© UPI Study. This article and its educational content are solely owned by UPI Study and licensed under CC BY-NC-ND 4.0. It is not free to reuse or modify. Any citation must credit UPI Study with a direct link to this page.