Categorical data place individuals into groups, such as transport choice or preferred activity. A two-way table records two categorical variables at once. The denominator you choose determines whether you describe the whole sample or a particular subgroup.
Counts and proportions answer different questions
A frequency is a count. A relative frequency divides a count by an appropriate total. Bar graphs compare category counts or proportions with separated bars; category order is not a numerical scale. A histogram, by contrast, groups quantitative values into adjacent intervals.
When comparing groups of different sizes, proportions are usually more informative than raw counts. A larger group can contain more people in every category without having a higher within-group preference rate.
Example: build marginal distributions
A survey records transport for 100 students:
| Grade | Walk | Bus | Total |
|---|---|---|---|
| Grade 9 | 18 | 42 | 60 |
| Grade 10 | 24 | 16 | 40 |
| Total | 42 | 58 | 100 |
The marginal distribution of transport uses the totals at the table's edge: 42% walk and 58% take the bus. The marginal distribution of grade is 60% Grade 9 and 40% Grade 10. Each describes one variable without conditioning on the other.
The joint proportion of students who are both Grade 10 and walkers is The word “both” points to one interior cell, while the denominator remains the entire sample.
Conditional distributions restrict the denominator
Among Grade 9 students, the walking proportion is Among Grade 10 students, it is These are conditional proportions: each denominator is the total of the group specified by “among.”
The Grade 9 transport distribution is 30% walk and 70% bus; the Grade 10 distribution is 60% walk and 40% bus. Each conditional distribution sums to 100% within its own group.
Because the distributions differ, grade and transport choice are associated in this sample. Association means knowing one variable changes the distribution of the other. It does not establish that grade causes a transport choice.
Two bars compare walking percentages: Grade 9 has 30 percent and Grade 10 has 60 percent.
Walking is more common within Grade 10: 60% versus 30%. These are within-grade percentages, so the different group sizes do not distort the comparison.
Describe this figure
Two bars compare walking percentages: Grade 9 has 30 percent and Grade 10 has 60 percent.
Grade 9: 30; Grade 10: 60.
Example: reverse the conditioning
Among walkers, what proportion are Grade 10? Now the condition is “walker,” so use the walking total 42. The answer is or about 57.1%.
This differs from the 60% of Grade 10 students who walk. The same cell count appears in both calculations, but the denominator changes. In probability notation, generally differs from
A reliable method is to say the restricted group aloud first, locate its total, then locate the desired category within that group. This prevents a memorized row-versus-column rule from failing when a table is rotated.
Visual comparisons should use a common scale
Side-by-side bars of conditional percentages can compare groups directly. Segmented bars can show each group's composition as a full 100%, with consistent category colors and labels. A count graph may be appropriate when total workload matters, but it answers a different question from a rate graph.
If two variables were independent, their conditional distributions would match: for example, the walking rate would be the same in both grades. In real samples, small differences can arise by chance, so a visible sample association is not automatically statistically convincing evidence about the population. A formal inference procedure addresses that question separately.
Beware of misleading aggregation
Combining groups can hide or reverse patterns if the groups have different sizes and different baseline rates. Always examine relevant conditional distributions before interpreting an overall percentage. A combined rate is a weighted average, not necessarily the simple average of subgroup percentages.
In the table, the overall walking rate is Averaging 30% and 60% equally would give 45%, incorrectly treating the two grades as equally large.
Try it yourself
Using the table, find the proportion of bus riders who are Grade 9 and the joint proportion who are Grade 9 bus riders.
Answer: Among bus riders, the conditional proportion is Among all students, the joint proportion is The numerator is the same; the population being described is different.
What to remember
Marginal distributions use table margins, joint proportions describe intersections within the full sample, and conditional proportions restrict the denominator. Compare conditional percentages to discuss association.