Math Core

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 120120 students to name their favorite lunch option.

Favorite lunch option of 120 students
  1. What percent of the students chose tacos?
  2. Describe the distribution.

Solutions.

  1. 24120=0.20\dfrac{24}{120} = 0.20, so 20%20\% chose tacos.
  2. Pizza was the most popular choice, named by 42120=35%\dfrac{42}{120} = 35\% of the students. Sandwiches (25%25\%) and tacos (20%20\%) came next, followed by salad (15%15\%). Only 5%5\% 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 pp gets a slice of 360∘⋅p360^\circ \cdot p. In the lunch data, pizza's slice would be 360∘⋅0.35=126∘360^\circ \cdot 0.35 = 126^\circ.

A pie chart only makes sense when the categories are non-overlapping and cover the whole group, so that the percents add to 100%100\%. If a survey says "choose all that apply," a person can land in several categories, the percents add to more than 100%100\%, 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 100%100\% 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 400400 students at Adams High and 150150 students at Baker High about how they usually get to school.

ModeAdams (count)Baker (count)
Bus1801803030
Car1201206060
Walk60604242
Bike40401818
Total400400150150

A reporter notes that more Adams students walk (6060) than Baker students (4242) 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:

ModeAdamsBaker
Bus0.450.450.200.20
Car0.300.300.400.40
Walk0.150.150.280.28
Bike0.100.100.120.12
How students get to school (left bar in each pair: Adams; right bar: Baker)

The reporter is wrong. Only 15%15\% of Adams students walk, compared with 28%28\% 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 (45%45\% versus 20%20\%), 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 8080 instead of 00, a value of 8282 gets a bar of height 22 and a value of 8888 gets a bar of height 88. The second bar looks four times as tall even though 8888 is less than 10%10\% larger than 8282. 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, 91%91\%; Company Q, 94%94\%. The vertical axis runs from 90%90\% to 95%95\%. How many times taller is Company Q's bar than Company P's? Is that a fair picture?

With the axis starting at 9090, Company P's bar has height 91−90=191 - 90 = 1 and Company Q's has height 94−90=494 - 90 = 4. Q's bar is 4 times as tall, but the renewal rates differ by only 33 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 28%28\% of Baker students walk, nearly twice the 15%15\% 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 6060 households on one street. Each household is counted by its main pet.

Main pet of 60 households
Practice 1

What percent of the households have a cat as their main pet?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Which statement about the pet data is correct?

Practice 3

In a pie chart, a category has a relative frequency of 0.150.15. What is the angle of its slice, in degrees?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

For which set of survey results would a pie chart be inappropriate?

Practice 5

In Town X, 8484 of 240240 surveyed residents said they would support a new park. In Town Y, 6363 of 150150 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.

Practice 6

A news graphic compares average test scores at two schools: 7676 and 7979. The bar for the second school is drawn three times as tall as the bar for the first. Which is the most likely explanation?

Practice 7

A relative frequency bar graph shows the favorite sport of 250250 students. The bars for soccer, basketball and football have heights 0.300.30, 0.240.24 and 0.180.18. 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.