Bar Charts, Pie Charts and Two-Way Tables
Summarize categorical data with frequency tables, bar and pie charts, and read joint, marginal and conditional percents in two-way tables.
Welcome back!
Step 1 of 13Learn
From a pile of answers to a table
The student council asks 200 students: What do you mostly do after school? The raw answers are a jumble of 200 words: sports, job, homework, sports, gaming, club, homework... Nobody can see a pattern in that.
The first step is a frequency table: list each category and count how many answers fall in it.
| Activity | Frequency | Relative frequency |
|---|---|---|
| Sports | 46 | 23% |
| Homework | 58 | 29% |
| Gaming | 40 | 20% |
| Clubs | 24 | 12% |
| Job | 32 | 16% |
| Total | 200 | 100% |
The relative frequency is each count divided by the total: 46 ÷ 200 = 0.23 = 23%. Relative frequencies are what let you compare groups of different sizes, like your school's 200 answers with another school's 650.
Check your table: frequencies must add up to the number of individuals, and relative frequencies to 100% (or very close, if you rounded).
Step 2 of 13Practice · Chart
What 200 students mostly do after school
Tap the activity with a relative frequency of 16%.
Tap the bar that answers the question, then press Check.
Step 3 of 13Practice · Work it out
In a survey of 250 students, 35 said their favorite subject is science. What is the relative frequency of science, as a percent?
Step 4 of 13Learn
Bar charts vs. pie charts
Once you have a frequency table, you can graph it.
A bar chart draws one bar per category, with heights showing counts or percents. Bars are separated by gaps because the categories are distinct, and their order doesn't matter, so sorting from tallest to shortest often makes the chart easiest to read. Bar charts are the best all-purpose choice for categorical data and make it easy to compare categories precisely.
A pie chart shows each category as a slice of a circle, with the slice angle proportional to its share. A category with 25% of the data gets a quarter of the circle, 90°. Pie charts emphasize parts of a whole, but they only work when:
- the categories don't overlap (each individual is in exactly one), and
- the slices add up to 100% of a meaningful whole.
If a survey lets people pick several answers, the percents can add up to more than 100%, and a pie chart becomes nonsense. Use a bar chart instead. Pie charts also make it hard to compare slices of similar size, so many statisticians prefer bars even when a pie is allowed.
Step 5 of 13Practice · Choose one
A survey asked students to select all the social media apps they use. The results add up to 230%. Which graph should you use?
Step 6 of 13Practice · Chart
The same table as a pie
A pie works here because each student gave exactly one answer, so the parts add up to 100%.
Tap the slice that is about one-eighth of the circle.
Tap the slice that answers the question, then press Check.
| Item | Share of students |
|---|---|
| Sports | 23% |
| Homework | 29% |
| Gaming | 20% |
| Clubs | 12% |
| Job | 16% |
Step 7 of 13Learn
Two-way tables
Sometimes you record two categorical variables for each person. A school surveys 9th and 12th graders about whether they have a part-time job:
| Has a job | No job | Total | |
|---|---|---|---|
| 9th grade | 12 | 108 | 120 |
| 12th grade | 45 | 45 | 90 |
| Total | 57 | 153 | 210 |
This is a two-way table. The numbers inside are joint frequencies (12 ninth graders have a job). The totals in the margins are marginal frequencies (57 students in all have a job).
The most useful numbers are conditional relative frequencies: percents within one row or column.
- Of 9th graders, 12 ÷ 120 = 10% have a job.
- Of 12th graders, 45 ÷ 90 = 50% have a job.
Because the percents differ a lot between grades, we say grade level and having a job are associated. If both grades had about the same percent, there would be no association. Comparing raw counts (12 vs. 45) would mislead, since the groups are different sizes; that's why conditional percents matter.
Step 8 of 13Practice · Work it out
Using the job table, what percent of the students who have a job are 12th graders? Round to one decimal place.
Step 9 of 13Practice · Chart
Job or no job, by grade (percent of each grade)
Each bar is one grade, scaled to 100%. These are conditional percents: we divided by each grade's own total.
Tap the grade where half the students have a job.
Tap the bar that answers the question, then press Check.
| Item | Has a job | No job |
|---|---|---|
| 9th grade | 10% | 90% |
| 12th grade | 50% | 50% |
Step 10 of 13Note
Step 11 of 13Practice · Fill in the blanks
Fill in the blanks
In the job table, the marginal total of students with no job is , and the joint frequency of 12th graders with no job is .
Step 12 of 13Practice · True or false
In a two-way table, if the conditional percents are very different for two groups, the two variables are associated.
Step 13 of 13Practice · Choose one
You want to compare the favorite music genres of 9th graders and 12th graders, and the grades have different numbers of students. Which display is best?
Lesson complete!