A school district surveys 400 juniors: do you have a part-time job, and how much do you usually sleep on a school night? Ask "what proportion of students with jobs sleep less than 7 hours?" and "what proportion of students who sleep less than 7 hours have jobs?" and you get two different numbers from the same cell of the same table. Every proportion from a two-way table is a count divided by some total, and the whole topic comes down to choosing the right total.
| Part-time job | Less than 7 hours | 7 to 8 hours | More than 8 hours | Total |
|---|---|---|---|---|
| Yes | 72 | 64 | 24 | 160 |
| No | 60 | 120 | 60 | 240 |
| Total | 132 | 184 | 84 | 400 |
Joint relative frequency: one cell out of everyone
A joint relative frequency is a cell count divided by the grand total. It describes individuals who are in a particular category of both variables, as a share of the whole table:
The proportion of all 400 juniors who have a job and sleep less than 7 hours is . The word "and" (or a phrase that pins down both variables, like "working students who sleep less than 7 hours, out of all juniors surveyed") is the signal.
Divide every cell by 400 and you get a table of joint relative frequencies. Its six cells add to 1, because each of the 400 students sits in exactly one cell:
| Part-time job | Less than 7 hours | 7 to 8 hours | More than 8 hours | Total |
|---|---|---|---|---|
| Yes | 0.18 | 0.16 | 0.06 | 0.40 |
| No | 0.15 | 0.30 | 0.15 | 0.60 |
| Total | 0.33 | 0.46 | 0.21 | 1.00 |
Marginal relative frequency: one variable, ignoring the other
A marginal relative frequency is a row total or a column total divided by the grand total. The name comes from where those totals sit: in the margins of the table. It describes one variable alone, as if the other had never been recorded:
Of all 400 juniors, have a part-time job, and sleep less than 7 hours. The marginal relative frequencies for one variable form that variable's distribution (0.40 and 0.60 for job; 0.33, 0.46 and 0.21 for sleep), and they appear as the totals row and column of the joint table above.
Conditional relative frequency: restrict to one group first
A conditional relative frequency is computed inside one row or one column only. You first restrict attention to a single category of one variable (the condition), then ask what share of that group falls in a category of the other:
Both of the opening questions are conditional, but they restrict to different groups:
- "Of the students with a job, what proportion sleep less than 7 hours?" The group is the Yes row, 160 students: .
- "Of the students who sleep less than 7 hours, what proportion have a job?" The group is the first column, 132 students: .
The numerator is the same 72 students. The denominators differ because the questions are about different groups. The words that set the condition ("of the," "among," "out of those who," "what percent of ... are") name the denominator. Read them, say the group out loud, and divide by its total. Topic 2.6 turns this same idea into conditional probability, .
Using conditional relative frequencies to judge association
Topic 2.1 compared groups by the proportions within each group. Those are conditional relative frequencies, and the full set for one group is a conditional distribution. For the juniors, condition on having a job:
| Part-time job | Less than 7 hours | 7 to 8 hours | More than 8 hours |
|---|---|---|---|
| Yes (out of 160) | 0.45 | 0.40 | 0.15 |
| No (out of 240) | 0.25 | 0.50 | 0.25 |
The two conditional distributions differ: 45% of working juniors sleep less than 7 hours, compared with 25% of non-working juniors, and working juniors are less likely to sleep more than 8 hours (0.15 against 0.25). Having a job and sleep amount are associated in this sample. You can state the size of the difference too: the proportion sleeping less than 7 hours is higher for working students, or times as large.
There is a reason the marginal proportion 0.33 sits between 0.45 and 0.25. The marginal is a weighted average of the conditionals, weighted by group size:
(The two products are the joint relative frequencies 0.18 and 0.15 from the joint table.) This gives a clean description of no association: if every group's conditional proportion is the same, the weighted average equals that common value, so each conditional distribution matches the marginal distribution. When the conditional distributions differ from each other, and so from the marginal, the variables are associated.
This survey shows that job and sleep go together, not why: working may cut into sleep, or students who stay up late anyway may be the ones who take evening shifts.
Worked examples
A museum surveys 500 visitors on the way out, recording whether each is a member and how they rate their visit.
| Visitor | Excellent | Good | Fair | Total |
|---|---|---|---|---|
| Member | 66 | 42 | 12 | 120 |
| Nonmember | 133 | 171 | 76 | 380 |
| Total | 199 | 213 | 88 | 500 |
Find (a) the proportion of all visitors who are members and rated the visit Excellent, (b) the proportion of all visitors who rated it Fair, (c) the proportion of members who rated it Excellent, and (d) the proportion of visitors rating it Excellent who are members. Name each kind of relative frequency.
Show solution
(a) Both conditions, out of everyone: a joint relative frequency. .
(b) One variable, out of everyone: a marginal relative frequency, from the Fair column total. .
(c) The group is members, so divide by the member row total: a conditional relative frequency. .
(d) The group is visitors who rated Excellent, so divide by the Excellent column total: also conditional, in the other direction. .
Parts (a), (c) and (d) all have 66 on top. What changes is the group named in the question, and so the denominator: everyone (500), members (120), or Excellent raters (199).
A gym has 250 members. 40% of them attend at least one group class a month. Of the members who attend classes, 70% renewed their membership this year; of those who don't, 30% renewed. What proportion of the members who renewed attend classes?
Show solution
Turn each percentage into a count, using the group it describes. Class attenders: , so non-attenders number . Renewed among attenders: . Renewed among non-attenders: . Fill in the table and its totals.
| Member | Renewed | Did not renew | Total |
|---|---|---|---|
| Attends classes | 70 | 30 | 100 |
| Does not | 45 | 105 | 150 |
| Total | 115 | 135 | 250 |
The question restricts to members who renewed, so divide by the Renewed column total: . About 60.9% of the members who renewed attend group classes.
Why build the table: the 70% and 30% are conditional on class attendance (row totals), but the question conditions on renewal (a column total). The counts let you switch directions. Note that 0.609 is not 0.70; mixing up the two directions is exactly the mistake the table prevents. As a check, the overall renewal rate equals the weighted average .
A high school offered a free test-prep course before students retook a college entrance exam. Of 600 students who retook the exam, the school recorded whether each took the course and whether their score went up by at least 50 points.
| Improved by 50 or more | Did not | Total | |
|---|---|---|---|
| Took the course | 90 | 60 | 150 |
| Did not take it | 135 | 315 | 450 |
| Total | 225 | 375 | 600 |
(a) What proportion of the students who improved by at least 50 points took the course?
(b) The principal says, "Only 40% of the students who improved took the course, so the course is not associated with improvement." Do you agree? Justify your answer with appropriate relative frequencies.
(c) Can the school conclude that the course caused scores to improve? Explain.
Show solution
(a) Restrict to the 225 students who improved: .
(b) No. The principal used the wrong conditional relative frequency. To see whether improving is associated with taking the course, compare the proportion who improved within each course group. Of the 150 students who took the course, improved by at least 50 points. Of the 450 who did not, improved. Students who took the course were twice as likely to improve (0.60 compared with 0.30), so these data show an association between taking the course and improving by at least 50 points. The 40% describes who the improvers were, not how likely each group was to improve, and it depends on the group sizes as well as the rates. Course-takers are only 150 of the 600 students, so even improving at twice the rate (0.60 against 0.30) they supply 90 improvers to the other group's 135. Read correctly, it even points toward association: course-takers are of all 600 students but 0.40 of the improvers.
(c) No. Students chose whether to take the course; it was not randomly assigned. Students who signed up may have been more motivated or studied more on their own, and those differences, not the course, could explain the higher improvement rate. Only a randomized experiment could support a cause-and-effect conclusion.
Why these moves: part (b) earns credit by comparing the two conditional proportions within each course group (the explanatory variable), stating both values, giving a direction, and concluding in context. Part (c) names the specific reason (self-selection, no random assignment) and a plausible alternative explanation.
Where students lose points
Check yourself
Question 1
A survey of 300 pet owners records pet type (dog or cat) and whether the owner bought pet insurance. 60 owners have a dog and bought insurance. There are 180 dog owners and 75 owners who bought insurance in all. Which value is a conditional relative frequency?
- A
- B
- C
- D
Show answer
C
restricts to dog owners (a row total) and asks what share of them bought insurance. is joint (a cell out of everyone); and are marginal (a total out of everyone).
- A
Question 2
Using the pet survey in the previous check, what proportion of owners who bought insurance own a dog?
Show answer
. Of the 75 owners who bought pet insurance, 80% own a dog.
The phrase "of owners who bought insurance" restricts to the 75 insurance buyers, so the denominator is that column total, not the 180 dog owners.
Question 3
In a two-way table of 1,000 voters, 30% of all voters favor a ballot measure. Among voters under 40, the proportion who favor it is also 0.30. Among voters 40 and over, which must be true if there are voters in both age groups?
- A
The proportion who favor it is 0.30.
- B
The proportion who favor it is 0.70.
- C
The proportion who favor it is less than 0.30.
- D
It cannot be determined without the number of voters under 40.
Show answer
A
The overall proportion is a weighted average of the two age groups' proportions: forces for any weight between 0 and 1. So the group sizes do not matter. Choice D is tempting, but the weighted-average fact makes the sizes irrelevant here.
- A
Question 4
Of 200 drivers, 80 drive electric cars. 56 electric-car drivers and 36 gas-car drivers say they charge or fuel up at work. Calculate the relevant conditional relative frequencies and say whether car type and fueling at work appear to be associated.
Show answer
Electric: . Gas: . Electric-car drivers in this sample were much more likely to charge or fuel at work (0.70 compared with 0.30), so car type and fueling at work appear to be associated.
There are gas-car drivers. The two conditional proportions differ substantially, which is what association between categorical variables means.