Contingency Tables and Cross-Tabulations
What you'll learn: How to explore relationships between two categorical variables by organizing their frequency counts into a structured table.
The Core Idea
A contingency table (also called a cross-tabulation or crosstab) displays the frequency distribution of two categorical variables simultaneously. Think of it as a grid where one variable defines the rows, another defines the columns, and each cell shows how many observations fall into that combination.
Analogy: Imagine surveying coffee shop customers about their preferred drink type (coffee, tea, juice) and time of visit (morning, afternoon, evening). A contingency table would show you exactly how many morning coffee drinkers you have, afternoon tea lovers, etc.—all in one glance.
Why This Matters
Contingency tables reveal patterns of association between categorical variables. You can spot whether certain categories tend to occur together (or avoid each other). For instance, do morning customers prefer coffee? Do evening visitors choose juice more often?
Beyond raw counts, you can compute:
- Proportions (row-wise, column-wise, or overall) to understand relative frequencies
- Conditional distributions (e.g., "Among tea drinkers, what % visit in the morning?")
When to Use This
Use contingency tables when:
- Both variables are categorical (nominal or ordinal)
- You want to understand if one categorical variable's distribution changes across levels of another
- You're preparing for statistical tests (like chi-square tests) that assess independence
This is a foundational step in bivariate analysis for categorical data—you're moving beyond single-variable frequency tables to understand joint behavior.
Key Takeaway: Contingency tables organize frequency counts of two categorical variables into a grid, revealing patterns and associations that simple frequency lists cannot show.