01 / 21

Categorical
Association

Learn how to organize, display, and interpret relationships between two categorical variables using two-way tables and conditional distributions.

College Statistics

What Are Categorical Variables?

A categorical variable places individuals into one of several groups or categories. Unlike numerical variables, categorical data cannot be meaningfully averaged or summed: instead, we count how often each category occurs.

Examples
Gender, political party, favorite genre, pass/fail, blood type
Not Categorical
Height, GPA, temperature, income: these are quantitative variables

The Two-Way Table

A two-way table (also called a contingency table) displays counts for every combination of two categorical variables. Rows represent one variable; columns represent the other.

Prefers Coffee Prefers Tea Total
Students 120 80 200
Faculty 90 60 150
Total 210 140 350

Three Types of Distributions

Joint
Each cell divided by the grand total. Shows the proportion in both categories at once: \(\frac{\text{cell}}{\text{grand total}}\).
Marginal
Row or column total divided by grand total. Describes one variable alone: \(\frac{\text{row total}}{\text{grand total}}\).
Conditional
Cell divided by its row (or column) total. Shows distribution of one variable given a fixed level of the other: \(\frac{\text{cell}}{\text{row total}}\).

Computing Conditional Distributions

Using our coffee/tea example for Students:

1
\(P(\text{Coffee} \mid \text{Student}) = \frac{120}{200} = 0.60\) (\(60\%\))
2
\(P(\text{Tea} \mid \text{Student}) = \frac{80}{200} = 0.40\) (\(40\%\))

These proportions must sum to \(1.00\) within each row.

Segmented Bar Charts

A segmented bar chart displays conditional distributions visually. Each bar represents one category of the explanatory variable, divided into segments for the response variable.

Students
\(60\%\)
\(40\%\)
Faculty
\(60\%\)
\(40\%\)
Coffee Tea

What Association Looks Like

Now consider different data where the conditional distributions do differ:

Exercise Regularly Don't Exercise Total
Under 30 140 60 200
30 and Over 80 120 200
Total 220 180 400
Under 30
\(70\%\)
\(30\%\)
30 and Over
\(40\%\)
\(60\%\)
Exercise Don't Exercise

Association vs. No Association

Association Present No Association
Conditional distributions Differ across groups Same across groups
Segmented bars Bars have different segment widths Bars look identical
Conditional \(\neq\) Marginal? Yes: knowing group changes the distribution No: group membership is irrelevant
Interpretation One variable helps predict the other Variables are independent

Formal Definition of Independence

If the observed counts closely match the expected counts, the data are consistent with independence. Large discrepancies suggest association.

How to Analyze a Two-Way Table

1
Identify the variables. Which is the explanatory (row) variable? Which is the response (column)?
2
Compute row totals and column totals. Include the grand total to complete the marginal distributions.
3
Calculate conditional distributions. Divide each cell by its row total to find conditional proportions.
4
Compare across rows. Do the conditional distributions differ noticeably? If yes, there is evidence of association.
5
Visualize. Draw a segmented bar chart to make the comparison clear and communicate findings.

Example 1: Study Method and Grades

A survey of 300 students recorded their primary study method and whether they earned an A in the course:

Earned A Did Not Earn A Total
Flashcards 48 72 120
Practice Problems 63 42 105
Re-reading Notes 15 60 75
Total 126 174 300

Example 1: Visualization

Flashcards
\(40\%\)
\(60\%\)
Practice Problems
\(60\%\)
\(40\%\)
Re-reading Notes
\(20\%\)
\(80\%\)
Earned A Did Not Earn A

Example 2: Computing Expected Counts

A hospital records patient satisfaction (Satisfied / Not Satisfied) by ward (A / B). Is there an association?

Satisfied Not Satisfied Total
Ward A 60 40 100
Ward B 90 10 100
Total 150 50 200

Example 2: Full Expected Table

Satisfied (Exp) Not Satisfied (Exp)
Ward A 75 25
Ward B 75 25
Ward A (Observed)
\(60\%\)
\(40\%\)
Ward B (Observed)
\(90\%\)
\(10\%\)
Satisfied Not Satisfied

Common Mistakes

✕ Confusing Joint and Conditional
Dividing a cell by the grand total gives a joint proportion, not a conditional one. To get a conditional proportion, divide by the row or column total.
✕ Comparing Counts Instead of Proportions
Unequal group sizes make raw counts misleading. Always convert to proportions before comparing across groups.
✕ Claiming Causation from Association
Association between two categorical variables does not mean one causes the other. Confounding variables may explain the pattern.

Summary of Key Concepts

Concept Formula / Rule Purpose
Joint Distribution \(\frac{\text{cell count}}{\text{grand total}}\). Proportion in both categories
Marginal Distribution \(\frac{\text{row/col total}}{\text{grand total}}\). Distribution of one variable
Conditional Distribution \(\frac{\text{cell count}}{\text{row total}}\). Distribution given a group
Expected Count \(\frac{(\text{row total})(\text{col total})}{\text{grand total}}\). Count under independence
Association Test Compare conditional distributions Detect relationship

Question 1 of 5

In a two-way table with a grand total of 500, row total of 200, and column total of 150, what is the expected count for that cell under independence?

Question 2 of 5

Two categorical variables show no association. Which of the following must be true?

Question 3 of 5

What is \(P(\text{Soccer} \mid \text{Left-handed})\)?

Question 4 of 5

A segmented bar chart shows that \(80\%\) of Group A prefers Option X, while only \(45\%\) of Group B prefers Option X. Which conclusion is most appropriate?

Question 5 of 5

In a two-way table, dividing each cell count by the grand total produces which type of distribution?