Conditional Frequencies
& Association
Learn to use conditional relative frequencies from two-way tables to determine whether categorical variables are associated or independent.
What Is a Two-Way Table?
A two-way frequency table (also called a contingency table) organizes data about two categorical variables. Rows represent categories of one variable, columns represent categories of the other, and each cell shows a count (frequency) of observations.
| Prefers Tea | Prefers Coffee | Total | |
|---|---|---|---|
| Under 30 | 40 | 60 | 100 |
| 30 and Over | 70 | 30 | 100 |
| Total | 110 | 90 | 200 |
Three Types of Frequency
Why Does Association Matter?
When two categorical variables are associated, the distribution of one variable changes depending on the value of the other. When they are independent, the distribution stays roughly the same across all groups.
Computing Conditional Relative Frequency
Example from our table: "Of those Under 30, what proportion prefers Tea?"
Conditioning by Row vs. by Column
You can compute conditional relative frequencies in two directions. The direction depends on your research question.
Association vs. Independence
| Associated | Independent | |
|---|---|---|
| Conditional distributions | Differ across groups | Same (or nearly same) |
| Knowing one variable | Changes predicted distribution | No change in prediction |
| Conditional vs. marginal | Conditional \(\neq\) marginal | Conditional \(\approx\) marginal |
| Example | \(40\%\) vs. \(70\%\) prefer Tea | \(55\%\) vs. \(55\%\) prefer Tea |
Step-by-Step Process
Example 1: Study Habits & Grades
A survey of 200 students asks about study habits and final grade. Is there an association between study method and grade earned?
| Grade A/B | Grade C/D/F | Total | |
|---|---|---|---|
| Group Study | 48 | 32 | 80 |
| Solo Study | 90 | 30 | 120 |
| Total | 138 | 62 | 200 |
Example 1: Conditional Frequencies
| Grade A/B | Grade C/D/F | |
|---|---|---|
| Group Study | \(\frac{48}{80} = 0.60\) | \(\frac{32}{80} = 0.40\) |
| Solo Study | \(\frac{90}{120} = 0.75\) | \(\frac{30}{120} = 0.25\) |
Example 2: Phone Brand & Gender
A school surveys 300 students about phone brand. Is phone brand independent of gender?
| Brand X | Brand Y | Total | |
|---|---|---|---|
| Male | 84 | 66 | 150 |
| Female | 86 | 64 | 150 |
| Total | 170 | 130 | 300 |
Example 2: Testing Independence
| Brand X | Brand Y | |
|---|---|---|
| Male | \(\frac{84}{150} = 0.56\) | \(\frac{66}{150} = 0.44\) |
| Female | \(\frac{86}{150} \approx 0.573\) | \(\frac{64}{150} \approx 0.427\) |
Example 3: Exercise & Stress
400 adults are surveyed about exercise habits and stress. Condition by column (exercise level) to see if stress distribution changes.
| Regular | Occasional | None | |
|---|---|---|---|
| Low Stress | \(\frac{90}{160} = 0.5625\) | \(\frac{50}{140} \approx 0.357\) | \(\frac{15}{100} = 0.15\) |
| High Stress | \(\frac{70}{160} = 0.4375\) | \(\frac{90}{140} \approx 0.643\) | \(\frac{85}{100} = 0.85\) |
Visualizing with Segmented Bars
A segmented (stacked) bar chart shows conditional distributions visually. If the segments are similar heights across bars, the variables are independent. If they differ, there is association.
Comparing to the Marginal
Another way to check for independence: compare each conditional relative frequency to the overall (marginal) relative frequency. If they match, the variables are independent.
Common Mistakes
Summary Reference
| Concept | Definition | Formula / Check |
|---|---|---|
| Joint Frequency | Count in one cell | Read directly from table |
| Marginal Frequency | Row or column total | Sum of a row or column |
| Conditional Relative Freq. | Proportion within a group | \(\dfrac{\text{joint}}{\text{marginal}}\) |
| Association | Variables are related | Cond. distributions differ |
| Independence | Variables unrelated | Cond. distributions \(\approx\) equal |
Question 1 of 5
In a two-way table, 60 out of 150 males prefer Brand A, and 80 out of 200 females prefer Brand A. What are the conditional relative frequencies of preferring Brand A given gender?
Question 2 of 5
If the conditional relative frequencies of "Passing" are \(0.85\) for Tutored students and \(0.60\) for Non-Tutored students, what can you conclude?
Question 3 of 5
A table shows 30 freshmen and 45 seniors prefer Science, out of 100 freshmen and 150 seniors total. To find the conditional relative frequency of "prefers Science" given "Freshman," you compute:
Question 4 of 5
Which of the following is the best evidence that two categorical variables are independent?
Question 5 of 5
A researcher surveys 500 people about transportation preference (Bus vs. Car) and area of residence (Urban vs. Suburban). The data:
Urban: 160 Bus, 40 Car (200 total)
Suburban: 90 Bus, 210 Car (300 total)
What is the conditional relative frequency of preferring Bus given Suburban, and what does it suggest?