Tables for One Categorical Variable
How to count categorical data into a frequency table, turn counts into relative frequencies, write the same share as a proportion, percent or ratio, and use the table to back up a claim.
A categorical variable sorts each observational unit into a group. A frequency table counts how many land in each group. A relative frequency table divides each count by the total, so you see each group’s share of the whole. Shares are what let you compare groups of different sizes and say clearly what the data show.
1Frequency tables
A school asks 250 students one question: “How did you get to school this morning?” Each answer is a category. On their own, 250 answers in a list are hard to read. Sorting them and counting each pile turns the list into something you can take in at a glance.
A frequency table shows the number of observational units in each category of a categorical variable. The number in each category is its frequency, which is just another word for count.
| How they got to school | Frequency (count) |
|---|---|
| School bus | 92 |
| Family car | 71 |
| Drove themselves | 38 |
| Walked | 33 |
| Biked | 11 |
| Other | 5 |
| Total | 250 |
Two things make a frequency table trustworthy. The categories must not overlap, so no student fits two of them. And together they must cover everyone, which is why an “Other” row is often needed. When both are true, the counts add up to the number of units, here 250.
Suppose the categories were “bus,” “car,” and “walked part of the way.” A student who rode the bus and then walked from the stop fits two rows and gets counted twice, so the counts add up to more than 250. Decide the rule first: here, each student is counted by the way they traveled the longest distance.
Twenty lunch choices
Twenty students in line at the cafeteria were asked what they chose for lunch:
pizza, salad bar, hot meal, pizza, sandwich, pizza, hot meal, salad bar, pizza, sandwich, pizza, hot meal, pizza, salad bar, sandwich, pizza, hot meal, pizza, salad bar, pizza
Make a frequency table and a relative frequency table.
- 1List the categories that appear: pizza, salad bar, hot meal, sandwich.
- 2Count each one. Cross off each answer as you count it so nothing is counted twice: pizza 9, salad bar 4, hot meal 4, sandwich 3.
- 3Check the total: \(9 + 4 + 4 + 3 = 20\), the number of students asked.
- 4Divide each count by 20: \(9 \div 20 = 0.45\), \(4 \div 20 = 0.20\), \(4 \div 20 = 0.20\), \(3 \div 20 = 0.15\).
- 5Check that the relative frequencies add to 1: \(0.45 + 0.20 + 0.20 + 0.15 = 1.00\).
2Relative frequency: each group’s share
A count alone does not tell you how big a group is compared with the whole. Ninety-two bus riders is a lot in a group of 250 and very few in a group of 5,000. The relative frequency of a category is its count divided by the total:
A relative frequency table shows the proportion of observational units in each category. Each relative frequency is a number from 0 to 1, and together they add to 1.
| How they got to school | Count | Relative frequency | Percent |
|---|---|---|---|
| School bus | 92 | 0.368 | 36.8% |
| Family car | 71 | 0.284 | 28.4% |
| Drove themselves | 38 | 0.152 | 15.2% |
| Walked | 33 | 0.132 | 13.2% |
| Biked | 11 | 0.044 | 4.4% |
| Other | 5 | 0.020 | 2.0% |
| Total | 250 | 1.000 | 100% |
When you round relative frequencies, their total can come out as 0.999 or 1.001 instead of exactly 1. That is a rounding effect, not a mistake. A total like 0.93 or 1.12 is a mistake: a category is missing, counted twice, or divided by the wrong total.
Homework devices
A survey asked 360 students which device they use most for homework. Part of the relative frequency table is shown.
| Device | Relative frequency |
|---|---|
| Laptop | 0.45 |
| Phone | 0.30 |
| Tablet | ? |
| Desktop | 0.10 |
Find the missing relative frequency and the number of students in each category.
- 1The relative frequencies of all categories add to 1, so tablet is \(1 - 0.45 - 0.30 - 0.10 = 0.15\).
- 2A count is the relative frequency times the total: laptop \(0.45 \times 360 = 162\), phone \(0.30 \times 360 = 108\).
- 3Tablet \(0.15 \times 360 = 54\), desktop \(0.10 \times 360 = 36\).
- 4Check: \(162 + 108 + 54 + 36 = 360\).
Every relative frequency in one table uses the same denominator: the total number of units. Dividing the bus count by the car count, \(92 \div 71\), gives a ratio between two groups, not the bus riders’ share of the school.
3The same share in many forms
Percentages, relative frequencies, and ratios all give the same information as a proportion. They are different ways of writing one fact.
| Form | Bus riders | When it reads best |
|---|---|---|
| Proportion (relative frequency) | 0.368 | In calculations and tables |
| Percent | 36.8% | In sentences for a general reader |
| Fraction or “out of” | 92 out of 250 | When the actual counts matter |
| Rate | about 37 in every 100 | When a whole number is easier to picture |
| Ratio | 92 to 158, bus to not bus | When comparing one group with the rest |
A park vote
In a city poll, 498 of 1,200 voters favor building a new skate park. Write this as a proportion, a percent, and a ratio of those in favor to those not in favor.
- 1Proportion: \(498 \div 1200 = 0.415\).
- 2Percent: multiply by 100 to get 41.5%.
- 3Those not in favor: \(1200 - 498 = 702\). The ratio in favor to not in favor is 498 to 702, which is about 0.71 to 1.
- 4All three forms describe the same split of the 1,200 voters.
4Comparing groups of different sizes
Relative frequencies earn their keep when you compare two groups with different totals. Comparing counts mostly compares the sizes of the groups.
Bus riders at two schools
At School A, 92 of 250 students rode the bus today. At School B, 160 of 640 did. A student says, “Riding the bus is more common at School B.” Is that justified?
- 1The counts favor School B: 160 riders against 92. But School B has far more students, so it would have more riders even if the bus were less popular there.
- 2Divide each count by its own school’s total. School A: \(92 \div 250 = 0.368\). School B: \(160 \div 640 = 0.25\).
- 336.8% of School A’s students rode the bus, compared with 25.0% at School B.
“School B has more bus riders” is true and says almost nothing about which school relies more on the bus. Whenever the groups have different totals, compare relative frequencies (or percents), and name both totals.
5Using a table to back up a claim
Counts and relative frequencies are evidence. A claim about a categorical variable is supported when you can point to the number that shows it. Watch the words that carry the claim.
| Word in the claim | What it means | Check |
|---|---|---|
| most, a majority | more than half | relative frequency greater than 0.5 |
| the most common | larger than any other category | largest count |
| about one in four | roughly 25% | relative frequency near 0.25 |
| more likely in group A than group B | a bigger share in A | compare relative frequencies, not counts |
The 250 students
Use the table of how 250 students got to school. Decide whether each claim is supported, and give the number that decides it.
- Most students rode the school bus.
- The school bus was the most common way to get to school.
- Fewer than half of the students came by car.
- About 1 in every 20 students walked.
- 11. “Most” means more than half. 36.8% is less than 50%. Not supported.
- 22. The bus has the largest count, 92, larger than any other category. Supported.
- 33. By car means family car or drove themselves: \(71 + 38 = 109\), and \(109 \div 250 = 0.436\). 43.6% is less than half. Supported.
- 44. 33 of 250 walked, and \(33 \div 250 = 0.132\), which is about 13 in every 100, or roughly 1 in 8. Not supported; 1 in 20 would be 5%.
The school bus is the most common way to school, but only 36.8% of the students rode it. “Most students rode the bus” is false. The largest category is a majority only when its relative frequency is above 0.5.
Give the claim, the number, and the context: “The school bus was the most common way to get to school: 92 of the 250 students, or 36.8%, rode it. That is not a majority, since it is less than half of the students surveyed.”
6Quick reference
| Term | Meaning | Example |
|---|---|---|
| Frequency | The count of units in a category | 92 rode the bus |
| Frequency table | Each category with its count | six ways to school, counts adding to 250 |
| Relative frequency | count ÷ total, a number from 0 to 1 | \(92 \div 250 = 0.368\) |
| Relative frequency table | Each category with its proportion; they add to 1 | 0.368, 0.284, 0.152, ... |
| Percent | relative frequency × 100 | 36.8% |
| Ratio | One count compared with another | 92 to 158 |
- Decide the categories so that every unit fits exactly one.
- Count each category, and check that the counts add to the total.
- Divide each count by the total for the relative frequencies, and check that they add to 1 (allowing for rounding).
- State any claim with its number and its context.