Lesson 1.2 · Exploring One-Variable Data
Displaying categorical data
A frequency table holds all the information about a categorical variable, but a good graph lets you see the pattern at a glance: which categories are common, which are rare, and how two groups differ. This lesson covers the standard displays for categorical data, how to use them to compare groups fairly, and how graphs can mislead.
Bar graphs
A bar graph (or bar chart) draws one bar for each category. The height of the bar is the category's frequency or relative frequency. The bars are separated by gaps, because the categories are separate groups, not points along a number line. The order of the bars is up to you: alphabetical, from most to least common, or a natural order such as "never, sometimes, often."
Worked example: Reading a bar graph
A cafeteria asked students to name their favorite lunch option.
- What percent of the students chose tacos?
- Describe the distribution.
Solutions.
- , so chose tacos.
- Pizza was the most popular choice, named by of the students. Sandwiches () and tacos () came next, followed by salad (). Only named some other option.
The category with the largest frequency is called the mode. Here the mode is pizza. Notice what you can't say about a categorical distribution: there is no mean, median or standard deviation of "lunch option," and words like "skewed" or "symmetric" don't apply, because you could list the categories in any order. You describe a categorical distribution by comparing how often each category occurs.
Pie charts
A pie chart shows how a whole is divided into parts. Each category gets a slice whose angle is proportional to its relative frequency, so a category with relative frequency gets a slice of . In the lunch data, pizza's slice would be .
A pie chart only makes sense when the categories are non-overlapping and cover the whole group, so that the percents add to . If a survey says "choose all that apply," a person can land in several categories, the percents add to more than , and a pie chart is impossible. A bar graph still works.
Bar graphs are usually the better choice anyway. People judge the heights of bars much more accurately than the angles of slices, and bar graphs can show any set of counts, not just the parts of a whole.
Comparing groups: relative frequencies
To compare the distribution of a categorical variable across two or more groups, use a side-by-side bar graph (bars for each group placed next to each other within every category) or a segmented bar graph (one bar per group, each tall and split into pieces for the categories).
Compare groups with relative frequencies
When the groups have different sizes, compare relative frequencies (proportions or percents), not counts. A bigger group will usually have bigger counts in every category, which tells you only that the group is bigger.
Worked example: Two schools
A district surveyed students at Adams High and students at Baker High about how they usually get to school.
| Mode | Adams (count) | Baker (count) |
|---|---|---|
| Bus | ||
| Car | ||
| Walk | ||
| Bike | ||
| Total |
A reporter notes that more Adams students walk () than Baker students () and concludes that walking is more popular at Adams. Is the reporter right?
Convert each column to relative frequencies by dividing by the school's total:
| Mode | Adams | Baker |
|---|---|---|
| Bus | ||
| Car | ||
| Walk | ||
| Bike |
The reporter is wrong. Only of Adams students walk, compared with of Baker students. Adams has more walkers only because it has more students. The graph shows the real differences: riding the bus is far more common at Adams ( versus ), while Baker students are more likely to come by car or on foot.
Misleading graphs
A graph can be accurate in every number and still leave a false impression. Watch for these:
- Truncated axis. If the vertical axis of a bar graph starts at instead of , a value of gets a bar of height and a value of gets a bar of height . The second bar looks four times as tall even though is less than larger than . Bar heights are only honest when the axis starts at zero.
- Pictographs that grow in two directions. If a picture of a barrel is drawn twice as tall and twice as wide to show "twice as much oil," its area is four times as large, and it looks four times as big.
- 3-D effects and tilted pie charts. Perspective makes the front slices look larger than the back slices.
Worked example: Spotting a truncated axis
A bar graph in an ad compares the percent of customers who renewed their subscriptions: Company P, ; Company Q, . The vertical axis runs from to . How many times taller is Company Q's bar than Company P's? Is that a fair picture?
With the axis starting at , Company P's bar has height and Company Q's has height . Q's bar is 4 times as tall, but the renewal rates differ by only percentage points. The truncated axis exaggerates a small difference.
Common mistake
Comparing raw counts between groups of different sizes is the most common mistake with categorical data. Before you say one group "has more" of something, ask: more in total, or a larger proportion? On the AP exam, a comparison based on counts when the groups differ in size will not earn credit.
Tip
When you describe or compare categorical distributions, always name the specific categories and give the percents, in context: "About of Baker students walk, nearly twice the at Adams." A vague "Baker walks more" is not a description.
Practice
The next two problems use this bar graph of the pets owned by households on one street. Each household is counted by its main pet.
What percent of the households have a cat as their main pet?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Which statement about the pet data is correct?
In a pie chart, a category has a relative frequency of . What is the angle of its slice, in degrees?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
For which set of survey results would a pie chart be inappropriate?
In Town X, of surveyed residents said they would support a new park. In Town Y, of surveyed residents said the same. By how many percentage points does the higher town's support rate exceed the lower town's?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
A news graphic compares average test scores at two schools: and . The bar for the second school is drawn three times as tall as the bar for the first. Which is the most likely explanation?
A relative frequency bar graph shows the favorite sport of students. The bars for soccer, basketball and football have heights , and . The only other category is "other," whose bar is missing from the graph. What should the height of the "other" bar be?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.