goals for this section
After completing this section, you should feel comfortable performing these skills.
- Read and interpret a two-way table.
- Make comparisons of different groups using side-by-side bar graphs.
- Make comparisons of different groups using stacked bar graphs.
- Identify the differences between side-by-side and stacked bar graphs.
Click on a skill above to jump to its location in this section.

In the upcoming activity, you will need a basic understanding of how contingency tables, stacked bar charts, and side-by-side bar charts are used to describe and analyze data on a single categorical variable for multiple populations or groups. To develop this understanding, let’s begin by recalling how we use a more familiar graphical display (a pie chart) to represent a categorical variable for a single population by analyzing percentages of votes cast for presidential candidates.
Visualizing a Categorical Variable for One Population
recall
Which types of displays are appropriate for a categorical variable?
Core skill:
Interactive example
Recall the techniques you used in What to Know About Displaying Categorical Data: 3A to read and interpret the following chart, which describes how people in America voted in the 2016 presidential election.[1] Take a moment to familiarize yourself with the chart, then answer Questions 1 – 3 below.

a) According to the chart above, what percentage of people living in the United States did not participate in the 2016 presidential election?
b) We can see from the chart that more people did not participate than those who did. A large percentage of those were deemed “ineligible to vote.”
Use the Internet to find out what it means to be “ineligible to vote” in a U.S. presidential election. Select all groups from the list below that can be deemed “ineligible” within the United States.
- American adults living in Puerto Rico
- American adults living in Guam
- American adults who at one time were convicted of felony crimes
- Americans under the age of 18
- American adults who are deemed mentally incapacitated
- Non-citizens and Dreamers (people living in the United States under DACA)
- All of the above
c) The variable of interest shown in the chart could be defined as “Voter Choice,” with five possible values:
Clinton, Trump, Other, Ineligible to vote, and Chose not to vote.
What is the best description of the population(s) of interest? There is only one correct answer.
-
- Three populations of interest: Republicans, Democrats, and Other
- Fifty populations of interest: One for every state that makes up our electoral college
- One population of interest: All people living in the United States
We’ve seen that a pie chart is a good visual representation of a categorical variable (Voter Choice) from a single population or group (people living in the United States). But what can we do if we want to compare a categorical variable across multiple groups?
Let’s use the variable from the data above, but instead of grouping all Americans together as a single population of interest, we’ll focus on just the voters in a presidential election.
Displaying a Categorical Variable Across Multiple Populations or Groups
In this example, we’ll explore how to display and interpret changes in a categorical variable of interest (Voter Choice) when comparing multiple populations or groups of interest (Black, White, Latinx, Asian, and Other). We will then convert tables of data called contingency tables (or two-way tables) into stacked bar charts and side-by-side bar charts and make comparisons.
The 2016 presidential race was very different from the one in 2020. In 2016, fewer people turned out to vote,[2] more people were deemed ineligible (6 million felons in 2016[3] compared to 5.1 million felons in 2020),[4] and the election results were much closer. In 2016, Hillary Clinton won the popular vote, and fewer than 80,000 votes out of 137 million votes cast determined the outcome of Donald Trump being selected as our president.[5]
Looking to our future, one question might be “If we increase legitimate voter participation, will one party benefit?” We can better answer this question if we study the voting patterns of different groups within the United States.
Contingency Tables (Two-Way Tables)
CNN used an exit poll to estimate the presidential 2020 voting patterns by race.[6] The following is a table of the results, where the rows describe the different groups of people of interest (White, Black, Latinx, Asian, and Other) and the columns represent the vote choices (Biden, Trump, or Other).
reading a contingency table
[Worked Example Video — a 3-instructors video illustrating the how to read a contingency table (how to see a single categorical variable measured on different sub-groups of a larger population — and how the data in the table is distributed into stacked and side-by-side bar charts]
| Presidential 2020 Voting Patterns by Race | |||
| Biden | Trump | Other | |
| White | 41 | 58 | 1 |
| Black | 87 | 12 | 1 |
| Latinx | 65 | 32 | 3 |
| Asian | 61 | 34 | 5 |
| Other | 55 | 41 | 4 |
Among Asians, for example, 61% voted for Biden, 34% voted for Trump, and the remaining 5% voted for someone else.
question 1
What are the two categorical variables present in the two-way table above?
Because this table displays the results of two categorical variables simultaneously, it is called a two-way table. It is also called a contingency table. The advantage of a contingency table is you can see each precise percentage of responses (or count of responses). A disadvantage is that the table does not present a strong visual comparison between the groups. Distributing the data from a contingency table into a stacked bar chart or side-by-side bar chart can help us visually compare the groups.

Side by Side Bar Graphs
For Questions 2–5, consider this standard side-by-side bar chart containing the exact same information as the previous table.
Reading a side-by-side Bar Graph
[We can insert another short video demonstration of how to read this graph.]–> this video would be great from 1:38-2:10

The groups of interest are listed on the horizontal axis (Whites, Blacks, Latinx, Asian, and Other) and the percentages associated with each voter choice are on the vertical axis. Note that within each group, the heights of the three bars sum to total 100, representing 100% of all responses within that group. Also note that since this side-by-side bar chart chose to represent percentages within groups (as opposed to the numbers of actual ballots cast within groups), you cannot make conclusions about counts of votes; rather, you can make conclusions about relative proportions or percentages within each group.
question 2
question 3
question 4
question 5
Does the graph indicate that the number of Asian people who voted for Trump is slightly higher than the number of Latinx people who voted for Trump? Explain.
Stacked Bar Graphs
For Questions 6 and 7, consider the following standard stacked bar chart showing the exact same information as the previous table and side-by-side bar chart.
Reading a stacked Bar Graph
[We can insert another short video demonstration of how to read this chart.]–> this video is pretty cool from 0:18-2:14

In this stacked bar chart, each bar represents the responses of one group. The height of each color within that bar represents a percentage of a particular response, and the combination of all colors represents the total (100%) of all responses within that group. Like the side-by-side bar chart where percentage is plotted along the vertical axis, you cannot make conclusions or comparisons regarding the absolute counts of responses within or between groups.
Note: A single stacked bar chart is very similar to a pie chart, but it uses rectangular regions rather than pie slices to represent each category.
question 6
question 7
When to use Side-by-Side vs. Stacked Bar Graphs
Note the difference between a side-by-side bar graph and a stacked bar graph displaying the same information. Each is useful to display a categorical variable across multiple groups. They only differ depending upon the perspective of the information you wish to present. A side-by-side bar graph is similar to a bar graph. If you felt a bar graph would best display your data, but you don’t want to use separate bar graphs (one for each group), then use a side-by-side bar graph to combine the two-way data into a single graph. If you felt a pie chart would best display your data, but didn’t want to use separate pie charts for each group, you could use a stacked bar graph to combine all three groups into one graph.
stacked versus side-by-side bar chart
[Perspective video — a 3-instructor video showing how to think which kind of display to use for which situation (advantages and disadvantages): stacked vs side-by-side bar chart.]
question 8
You have categorical data that you’d like to present in a bar graph but don’t want to use a separate graph for each of the multiple groups present. You’d like to be able to compare the variable across all the groups simultaneously in the same graph. Which visualization could you use instead? Explain your choice.
question 9
What type of visualization will permit you to display relative frequencies of a variable across multiple groups in the way similar to a pie chart, which regions representing percentages? Explain your choice.
Summary
In this section, you’ve seen representations of voter patterns by race in the 2020 presidential election. In the following Forming Connections activity, we’ll explore the possibility of making predictions about how future election outcomes by asking a research question about racial composition in the United States. Let’s summarize all the skills and tasks you’ve applied so far before you dive into the next activity.
- In Questions 1 – 3, you read and interpreted information from a pie chart.
- in Question 4, you read and interpreted information from a two-way (contingency) table.
- In Questions 5 – 8, you read and interpreted a side-by-side bar chart.
- In Questions 9 – 10, you read and interpreted a stacked bar chart.
- In Questions 11 – 12, you explained the differences between side-by-side charts and stacked bar charts.
Pie charts are good tools for visualizing a single categorical variable for multiple populations or groups. When we want to display and interpret changes in a categorical variable of interest while comparing multiple populations or groups, we can organize the data into a contingency table (two-way table), which we can then convert into side-by-side bar charts or stacked bar charts. These kinds of charts provide a stronger visual comparison between the groups than the two-way table does.
If you feel comfortable with these ideas, it’s time to move on to Forming Connections in the next activity!
- Bump, P. (2016, November 16). A lot of nonvoters are mad at the election results. If only there were something they could have done. The Washington Post. https://www.washingtonpost.com/news/the-fix/wp/2016/11/16/a-lot-of-non-voters-are-mad-at-the-election-results-if-only-there-was-something-they-could-have-done/ ↵
- Schaul, K., Rabinowitz, K., & Mellnik, T. (2020, December 28). 2020 turnout is the highest in over a century. The Washington Post. https://www.washingtonpost.com/graphics/2020/elections/voter-turnout/ ↵
- Uggen, C., Larson, R., & Shannon, S. (2016, October 16). 6 million lost voters: State-level estimates of felony disenfranchisement, 2016. The Sentencing Project. https://www.sentencingproject.org/publications/6-million-lost-voters-state-level-estimates-felony-disenfranchisement-2016/ ↵
- Maxouris, C. (2020, October 15). More than 5 million people with felony convictions can’t vote in this year’s election, advocacy group finds. CNN. https://www.cnn.com/2020/10/15/us/felony-convictions-voting-sentencing-project-study/index.html ↵
- Why voting matters: Supreme Court edition. (2018, June 28). Axios. Retrieved from https://www.axios.com/hillary-clinton-2016-election-votes-supreme-court-liberal-justice-1b4bc4fc-9fad-44b4-ab54-9ef86aa9c1f1.html ↵
- Exit polls. (2020). CNN Politics. Retrieved from https://www.cnn.com/election/2020/exit-polls/president/national-results ↵