Tutorials › AP Statistics › Bar Chart Versus Segmented Bar Chart: Picking the Right One

Graphs for categorical data · Tutorial 57 of 1000

Bar Chart Versus Segmented Bar Chart: Picking the Right One

Choose a graph by asking whether you want to display one categorical variable or compare the relationship between two categorical variables.

Beginner 9 min read

What You'll Learn

  • Decide whether a question asks about one categorical variable or the relationship between two.
  • Choose a bar chart to display a single categorical distribution.
  • Choose a segmented bar chart to compare a response distribution across groups.
  • Recognize when a two-way table calls for a marginal distribution rather than a relationship display.
  • Explain how group sizes and denominators affect what each graph shows.
  • Avoid claiming that a graph choice by itself establishes an association or cause.

Start With the Question, Not the Data Table

A categorical data set can often be displayed in more than one way. The right choice depends on what you want a reader to learn. If the question is about the distribution of one categorical variable, a bar chart is usually appropriate. If the question is whether a categorical response varies across groups defined by another categorical variable, a segmented bar chart is usually a better choice.

This builds on Choosing Between Bar Chart, Pie Chart, and Histogram, which introduced bar charts for categorical distributions. It also uses the segmented bar charts from Reading a Segmented Bar Chart and Using a Segmented Bar Chart to Check for Association. The key decision is whether you are describing one variable or comparing conditional distributions of a response across groups.

Definition: Use a bar chart to display the counts or relative frequencies of the categories of one categorical variable. Use a segmented bar chart to display the conditional distribution of a categorical response variable within each category of a second categorical grouping variable. Each group’s bar represents \(100\%\) of that group.

A data set might include two categorical variables even when a question asks about only one of them. For example, a survey could record both a student’s school and preferred lunch. If the question asks which lunch option is most popular overall, the school variable is not part of the question. A bar chart of the overall lunch distribution fits. If the question asks whether lunch preferences differ by school, both variables matter, so a segmented bar chart can show the comparison.

A Quick Decision Process

Before choosing, identify the observational units and variables, as in Confusing Observational Units With Variables. Then phrase the question in terms of what the graph should display. The phrase “one variable or two?” is a useful first check, but it is not enough on its own: a table may contain two variables while the question still concerns just one marginal distribution.

1
Name the target variable or variables.
Ask what categories the question asks you to describe. A question about one response variable calls for a display of that variable’s distribution.
2
Decide whether groups are part of the comparison.
If the question compares a response across groups, identify the grouping variable and the response variable. A relationship question is about how the response distribution changes from group to group.
3
Choose the graph that matches the comparison.
Use a bar chart for a single distribution. Use a segmented bar chart when comparing the conditional distribution of a categorical response within groups.
4
Check what the bar heights represent.
For a one-variable bar chart, bars may show counts or relative frequencies. For a segmented bar chart, each whole bar is \(100\%\), and the segments show within-group percentages.

That final check matters because the two displays answer different questions. A bar chart of counts tells how many individuals fall in each category. A segmented bar chart emphasizes how the composition of each group compares, using percentages within each group. As discussed in Comparing Groups of Different Sizes With Percent Graphs, counts and within-group percentages are not interchangeable.

Worked Example: One Variable, One Distribution

Worked Example: One Variable, One Distribution

A fictional survey asks 80 students to choose one preferred after-school activity. The recorded variable is activity preference. The counts are: sports, 32; music, 24; art, 16; and clubs, 8. The question is, “Which activity is most popular among these surveyed students, and how are the preferences distributed?”

Identify the question. It asks about one categorical variable, activity preference. It does not ask whether preferences differ by grade, school, or another grouping variable. A bar chart is the appropriate choice.

Choose the measure. Counts can show how many students chose each activity. Relative frequencies show the share of the 80 students in each category. For example, the sports relative frequency is \(32/80=0.40\), or \(40\%\). The full distribution is:

ActivityCountRelative frequency
Sports32\(32/80=0.40\), or \(40\%\)
Music24\(24/80=0.30\), or \(30\%\)
Art16\(16/80=0.20\), or \(20\%\)
Clubs8\(8/80=0.10\), or \(10\%\)

The counts add to \(32+24+16+8=80\). The relative frequencies add to \(0.40+0.30+0.20+0.10=1.00\), or \(100\%\). A bar chart can display either set of values. A relative-frequency version makes the shares explicit, while a count version emphasizes the number of students in each category.

A segmented bar chart would not answer this question better: no groups are being compared, and there is no second categorical variable in the question. If the survey had also recorded grade, that extra information would not automatically require a segmented chart. The graph should match the question being asked, not every variable the data happen to contain.

Worked Example: Comparing a Response Across Groups

Worked Example: Comparing a Response Across Groups

A fictional poll asks 100 library visitors whether they would use a proposed evening study room. The two categorical variables are visitor location (North branch or South branch) and response (yes or no). At the North branch, 30 of 40 visitors say yes and 10 say no. At the South branch, 30 of 60 say yes and 30 say no. The question is, “Does support for the study room differ between the branches?”

Identify the comparison. The question asks whether the response distribution differs across categories of location. The grouping variable is branch, and the response variable is support. A segmented bar chart is appropriate because it shows the conditional response distribution within each branch.

Use each group’s total as the denominator. At the North branch, the percentage answering yes is \(30/40 \times 100\%=75\%\), and the percentage answering no is \(10/40 \times 100\%=25\%\). At the South branch, the yes percentage is \(30/60 \times 100\%=50\%\), and the no percentage is \(30/60 \times 100\%=50\%\). Within each branch, the segments total \(100\%\).

BranchYesNoGroup total
North\(30/40=75\%\)\(10/40=25\%\)40
South\(30/60=50\%\)\(30/60=50\%\)60

Each branch’s bar in the segmented chart has the same total height, representing \(100\%\). Its yes and no segments divide that bar according to the branch’s conditional percentages. The graph would show a larger yes segment for North than for South, matching the difference between \(75\%\) and \(50\%\). In this sample, the conditional distributions differ, which is evidence of an association between branch and response in the displayed data.

The count of yes responses is 30 at each branch, but the within-branch percentages are different because the group totals differ. A graph of counts alone could hide that comparison. As in Choosing the Correct Denominator for a Percentage, the wording “within each branch” tells us to divide by the relevant branch total, not by the grand total of 100.

Two Variables Do Not Always Mean a Segmented Bar Chart

A two-way table contains information about two categorical variables, but you may still be asked about the distribution of just one. In that case, use the marginal distribution for the variable named in the question. The marginal distribution ignores the split across the other variable by combining its categories.

This distinction prevents a common shortcut: “There are two categorical variables, so use a segmented bar chart.” Instead, ask whether the question is about a relationship. If it asks for an overall distribution, a bar chart can display the relevant marginal counts or percentages. If it asks how that distribution varies across groups, a segmented bar chart can display conditional percentages.

Worked Example: Two Variables, but an Overall Question

Worked Example: Two Variables, but an Overall Question

Use the library poll from the previous example. The table includes both branch and response. Now suppose the question is, “What percentage of all surveyed visitors support the study room?” This asks for the overall distribution of the response variable, not a comparison between branches.

Find the marginal counts. The total number answering yes is \(30+30=60\). The total answering no is \(10+30=40\). These counts add to the grand total, \(40+60=100\).

Calculate the overall percentages. The overall yes percentage is \(60/100 \times 100\%=60\%\). The overall no percentage is \(40/100 \times 100\%=40\%\). A bar chart of the response variable’s marginal distribution answers the question directly: 60% support the proposal and 40% do not.

A segmented bar chart would show the two branch-specific distributions, which is useful for asking whether support differs by branch. But that is not the question here. The overall bar chart combines the branches and displays the single response distribution. This is why naming the question before selecting the graph is more reliable than counting how many variables appear in the data table.

What Each Graph Makes Easy to See

A bar chart makes category frequencies easy to compare for one variable. The bars may represent counts or relative frequencies, and the vertical axis should identify which measure is used. The graph does not, by itself, show how a second variable relates to the categories unless the display includes groups in some other way.

A segmented bar chart makes within-group composition easy to compare. Since every group bar has the same total height, differences in group size are not shown by the total bar heights. Instead, the segment sizes represent conditional percentages. Use it when the question is about how common a response is within each group, not which group has more individuals overall.

A segmented bar chart can make small percentage differences difficult to judge precisely, especially when there are many categories or groups. For exact comparisons, calculate the conditional percentages as in Comparing Conditional Percentages in Context and report them alongside the graph. If the question is about counts, be clear that segment percentages do not give the group sizes; consult the counts in the table or use a display designed to show counts.

Finally, a graph can describe patterns in the data but does not establish that one variable causes another. If a segmented bar chart shows different response distributions across groups, describe the observed association in context. Do not claim that group membership caused the difference unless the design and evidence support a causal conclusion.

Common Mistakes and AP Exam Tips

  • Choosing from the number of variables alone. Two variables may be present, but the question may ask for only one variable’s marginal distribution. State whether the task is to describe one distribution or compare conditional distributions across groups.
  • Using the grand total for each segment. A segmented bar chart shows a response distribution within each group. Divide a cell count by that group’s total, not by the grand total, as in the tutorials on conditional distributions.
  • Reading a segmented bar as counts. Each full bar represents \(100\%\) of a group. Its segments show conditional percentages, not how many individuals are in the group. Check the table for group sizes when those counts matter.
  • Assuming equal bar heights mean equal group sizes. In a segmented bar chart, bars have equal total height by design. They represent equal percentages, not necessarily equal numbers of individuals.
  • Claiming an association proves causation. A difference in conditional distributions describes a pattern in the data. It does not, by itself, establish that the grouping variable caused the response difference.
  • Giving a graph name without a reason. A complete answer links the choice to the question. For example: “Use a segmented bar chart because the question compares the conditional distribution of response within each branch.”

On an exam, first name the variable or variables that the question concerns. Then explain what the display should make easy to compare. A strong answer says why the selected graph matches the goal, and, for a segmented chart, identifies the within-group percentages as the quantities shown.

Key takeaway: Choose a bar chart for the distribution of one categorical variable. Choose a segmented bar chart when the question compares a categorical response across groups, using conditional percentages within each group. Let the question—not simply the number of variables in the data—determine the display.

Check Your Understanding

For each situation, choose a bar chart or a segmented bar chart and explain what the graph should display.

  1. A survey records favorite fruit from 120 shoppers. The question asks which fruit is most popular overall. Which graph is appropriate, and what do its bars represent?
  2. A school survey records students’ grade and preferred type of music. The question asks whether music preference differs by grade. Which graph is appropriate, and what should each full bar represent?
  3. A table records residents’ neighborhood and whether they support a park renovation. The question asks for the overall percentage who support it. Why is a bar chart of the marginal response distribution suitable even though the table has two variables?
  4. Two groups have different sample sizes. In a segmented bar chart, what does the height of each full group bar show, and where would you look to find the group counts?
  5. A segmented bar chart shows different response percentages across two groups. What can you conclude about the displayed distributions, and what causal claim should you avoid?