Learning Goals
Deepen your understanding and form connections within these skills:
- Use a data analysis tool to create a side-by-side or stacked bar graph from a data set.
- Use a data analysis tool to create a side-by-side or stacked bar graph from a two-way table.
- Read and interpret side-by-side and stacked bar graphs to compare different groups.
What’s in a Generation?
In the previous activity, we saw that voter patterns varied by race in 2020. If we wish to predict potential changes in future voting outcomes, we may want to research the following question: Has the racial composition changed in the United States across generations? In this activity, you’ll see how side-by-side and stacked bar charts can be useful tools in studying and comparing the distributions of categorical variables for different populations or groups.

Before you begin to visualize the information presented in the two-way table below, think for a moment about how racial composition may or may not have changed from your perspective.
question 1
video placement
[Intro: “What do you think? Does the racial composition of your state or community look differently today than it did for your parents or grandparents? How would we be able to show this statistically? The goal of this activity is to use a contingency table (also known as a two-way table) to create stacked and side-by-side bar charts, and then use those charts to answer research questions. We’ll use a data set from the Pew Research Center that aggregates survey and census data to provide information about the racial composition of four different generations in the United States. Before we begin, let’s take a look at the contingency table we’ll be using. [voice over the contingency table “We’ll be learning about contingency tables throughout the semester. The real goal of this activity is to use the technology, so don’t worry if reading the information from the table feels awkward. Let’s just zoom in to the first column. Here, we see the “Boomers” generation (these are Americans born before 1962) have a racial composition that is 81.2% white. As succeeding generations are born, though, the percentage made up by whites decreases to 70% for Gen Xers, 51% for Millennials, and for Gen Z (born after 1996), the percentage is only 51%. If we add up all the percentages for Boomers, we see that they add up to 100% (or close to that, there can be some rounding error). The most important part of this activity, though, is not the table but the technology. We’ll be using the same tool as in the previous section, and the instructions are listed in the page for you step-by-step. It will get easier using the tool as the course moves forward. So, take a little time for yourself to digest the table and the information given below, then move on to the technology.”]
The following table[1] provides the racial composition for four different generations in the U.S.: Baby “Boomers” (born before 1962), “Gen Xers” (born 1965–1980), “Millennials” (born 1981–1996), and “Gen Zers” (born after 1996).
| Racial Composition Across Generations | |||||
| Generation | White | Hispanic | Black | Asian | Other |
| Boomers | [latex]81.20[/latex]% | [latex]4.00[/latex]% | [latex]12.90[/latex]% | [latex]1.00[/latex]% | [latex]1.00[/latex]% |
| Gen X | [latex]70.00[/latex]% | [latex]12.00[/latex]% | [latex]15.00[/latex]% | [latex]0.00[/latex]% | [latex]3.00[/latex]% |
| Millennials | [latex]61.00[/latex]% | [latex]17.00[/latex]% | [latex]15.00[/latex]% | [latex]4.00[/latex]% | [latex]3.00[/latex]% |
| Gen Z | [latex]51.00[/latex]% | [latex]24.50[/latex]% | [latex]13.70[/latex]% | [latex]5.90[/latex]% | [latex]4.90[/latex]% |
The table contains survey information on the racial composition of similar groups of people ([latex]7–22[/latex] years old) at similar points in time within each generation. For example, an analysis of the 1987 Current Population Survey (CPS) of Americans reported the racial and ethnic composition of Gen Xers (born between 1965 and 1980) was [latex]70[/latex]% White, [latex]12[/latex]% Hispanic, [latex]15[/latex]% Black, [latex]0[/latex]% Asian, and [latex]3[/latex]% Other. Asians were not separately identified by the population survey until 1988.
While this contingency table contains information needed to make a descriptive analysis, any significant changes in racial composition between generations will be more evident in a side-by-side bar chart than in the table. In this activity, you’ll use technology to create a side-by-side bar graph and a stacked bar chart, then you’ll interpret the visualizations.
Using Data Sets
Let’s use technology to create a side-by-side bar chart to visualize changes in the racial composition. Follow these steps:
Go to the Describing and Exploring Categorical Data at https://dcmathpathways.shinyapps.io/EDA_categorical/
Step 1) Select the Two Categorical Variables tab.
Step 2) Locate the dropdown under Enter Data and select From Textbook.
Step 3) Locate the dropdown under Data Set and select Generations in the US.
Step 4) Locate Conditional Distribution and Marginal Distribution and select Don’t show for both.
The tool will have created a contingency table showing approximate counts out of every [latex]100[/latex] people to align with the percentages reported in the CPS followed by a side-by-side bar graph showing percentages.
question 2
question 3
To see how useful a graph is for making comparisons, try using the contingency table instead to find the answers to Question 3. Visual displays are powerful tools for analyzing distributions and comparing them across groups.
Now, let’s create a stacked bar chart to compare to the side-by-side bar graph you created.
question 4
question 5
question 6
video placement
[sub-summary: Did you see how much easier it is to answer questions about the data using the graph rather than the table?[voice over the table and graphs for this as appropriate] For example, when looking for a category that remained fairly constant through the generations, it was easy to see in the bar graph that the bar for Black Americans remained at a constant height. Information that is difficult to pick out of a table can become obvious and intuitive from looking at a graphical display. What did you think about the difference between the side-by-side bar graphs and stacked bar graphs? Was there any information that was easier to read from the stacked bar charts? They do offer a more compact visual. The portion of each generation made up of Hispanic Americans was easy to see increasing from the stacked charts and may have been a bit hidden in the side-by-side bar graphs. The stacked charts certainly seem to imply, though, that each generation is of equal size, which is untrue. Boomers and Millennials are bigger than the others. “]
College Students, Generationally
A first-generation college student is defined federally as a student whose parents both do not have a bachelor’s degree. There are further qualifications and exceptions, such as in the case of a student whose older sibling, aunt or uncle, or grandparent completed a [latex]4[/latex] year degree (still first-generation) or in the case of a student who received support soley from one parent regardless of whether the other parent has a degree (still first-generation). First-generation college students do not have the advantage of experience-based guidance from their primary caregiver.
In questions 7 – 10 below, let’s explore the following question: “Are first-generation college students more likely to have their first language different from English when compared to non-first-generation college students?”
question 7
question 8
question 9
question 10
Using Two-way Tables
Questions 11 – 12 ask about the following contingency table, which summarizes national survey data from the Community College Survey of Student Engagement (CCSSE) 2020 Cohort.
Note: The first language status in the CCSSE survey is measured by: “Enrolled in English course taught specifically for students whose first language is not English (ESL, ESOL).”
| First Language Status | ||
| Not First Generation | First Generation | |
| Not ESL | [latex]152,232[/latex] | [latex]88,281[/latex] |
| ESL | [latex]8,145[/latex] | [latex]9,875[/latex] |
video placement
[Guidance: [voice over the steps below and the tool] Let’s go to the data analysis tool and click on Two Categorical Variables. Then choose Contingency Table under Enter Data. We’ll change the Row Variable Name to ESL and the Category Labels to “Not ESL” and “ESL.” And we’ll change the Column Name to “First Generation” and the Category Labels to “Not First Gen” and “First Gen”. You can use your own variable names and category labels if you wish. The idea is to match the table in the tool to the contingency table shown in the page. [Show that they are the same now]. Finally, enter the data from the First Language Status table in the page (when entering the numbers, don’t include the comma). Once you have the data entered, the side-by-side bar graph should display. All the steps are listed in the page below for you to follow when recreating this activity.”]
Create your own side-by-side bar graphs and stacked bar charts for this contingency table using the Describing and Exploring Categorical Data at https://dcmathpathways.shinyapps.io/EDA_categorical/.
Step 1) Select the Two Categorical Variables tab at the top of the screen.
Step 2) Under Enter Data choose Contingency Table from the drop down menu.
Step 3) Name the rows and columns appropriately as shown in the table above.
Step 4) Under Enter Counts for Contingency Table enter the values from the table above without the commas.
Step 5) Under Contingency Table choose Totals. Leave Joint Distribution unchecked.
question 11
Comparing Groups
question 12
video placement
[Wrap-up: What were you able to observe about side-by-side bar graphs you created for the First Language Status contingency table? If the technology felt awkward to use, that’s perfectly normal at this point! It will get better as the course moves along and you have more opportunities to use it. Likewise, following a contingency (or two-way table) is a skill that will improve the more you get to practice with it. For now, we were really just concerned with gaining familiarity using the technology. Did you recognize the objectives for the activity? We created side-by-side and stacked bar graphs from a data set and from a contingency table and interpreted them to learn more about the data sets.” ]
- Parker, K. & Igielnik, R. (2020, May 14). On the cusp of adulthood and facing an uncertain future: What we know about Gen Z so far. Pew Research Center. https://www.pewresearch.org/social- trends/2020/05/14/on-the-cusp-of-adulthood-and-facing-an-uncertain-future-what-we-know-about-gen-z- so-far-2/ ↵