When we collect data that sorts individuals into categories or labels, a raw list of responses is hard to read, so we need a way to organize and picture how often each category shows up.
1
Frequency and Relative Frequency Tables
A categorical variable places each individual into a group or label (like a bug type), unlike a quantitative variable, which records numbers we can average or do arithmetic on. To see the distribution of a categorical variable (what categories it takes and how often it takes them), we count the responses in each category to build a frequency table, and then find each category's share of the whole to build a relative frequency table.
Suppose a game studio receives 20 user bug reports after an update: Crash, Audio, Lag, Lag, Billing, Crash, Lag, Visual, Lag, Audio, Crash, Lag, Lag, Visual, Crash, Lag, Audio, Lag, Crash, and Lag. We want to organize this list into a table and compare its 9 Lag reports with a much larger server that had 45 Lag reports out of 1,000 total reports.
Frequency and Relative Frequency Tables
Text solution
Count each categoryCount how many times each bug type appears in the 20 reports so the category counts add up to the total.
Divide by the total to find relative frequenciesDivide each category's count by the 20 total reports to see what fraction or percentage of the complaints it makes up.
share of the wholeRelative frequency=TotalCategory count=209=0.45=45%(for Lag)
Compare groups of different sizes using sharesDivide each server's Lag count by its own total number of reports so we can compare them fairly.
Small server:209Big server:1,00045=0.45=45%=0.045=4.5%
So Lag is a much bigger share of the complaints on the small server (45% of all reports) than on the big server (4.5% of all reports), even though the big server had more Lag complaints (45 vs. 9).
In any relative frequency table, the shares together make up the entire group of data, so the column adds up to 1.00 (100%). If a table has repeating decimals like 31≈33.3%, the rounded percentages might add up to 99.9% or 100.1% simply because of rounding error.
2
Finding Counts from Percentages
Summary reports often give only the percentages for each category and list the total sample size at the bottom. To find the original count for a category from its percentage, we work backward from the total.
Suppose a weekly report based on 400 bug reports lists Crash at 25%, Audio at 15%, and Billing at 3.3%. We want to find the actual number of Audio and Billing tickets submitted.
Finding Counts from Percentages
Text solution
Multiply the decimal share by the totalSince dividing the count by the total gave the relative frequency, multiplying the relative frequency by the total gives the count back.
Audio count=share0.15×total400=60 reports
Round decimal results back to a whole countWhen a rounded percentage in a table gives a decimal count, round to the nearest whole number because individual reports only come in whole numbers.
Billing count=0.033×400=13.2⟶13 reports
(since 40013=0.0325=3.25%≈3.3%)
So the studio received 60 Audio reports and 13 Billing reports out of the 400 total tickets.
3
Bar Charts and Pareto Charts
A table gives exact numbers, but we have to read every row to compare them. A bar chart turns the table into bars our eyes can compare right away by giving each category a bar whose height matches its count or relative frequency.
Let's turn our frequency table of 20 bug reports into a bar chart and see how ordering the bars changes how easy the chart is to read.
Bar Charts and Pareto Charts
Switching the vertical axis from counts to percentages changes only the numbers on the scale, leaving the relative heights of the bars the same. Unlike a graph along a number line, a bar chart always leaves gaps between the bars to show that the horizontal axis has separate categories.
Because categories have no number order on the horizontal axis, rearranging the bars never changes the distribution, and sorting them from tallest to shortest (called a Pareto chart) makes the ranking easy to read.
Reordering the bars never changes the data, and sorting them from tallest to shortest makes the ranking easy to see right away.
4
Pie Charts and When They Fail
A pie chart slices a circle so that each category's angle matches its share of the whole. While a pie chart quickly shows that a category like Lag (45%) takes up nearly half of a single group, our eyes judge side-by-side bar heights much more accurately than angles. Also, for many categorical datasets, we cannot draw a pie chart at all.
Let's check whether we can use a pie chart in two new situations: first, a checkbox survey of 100 players where 60% checked Lag, 50% checked Crash, and 30% checked Audio; second, a platform report showing that 12% of PC players, 8% of PlayStation players, and 5% of Xbox players experienced a crash.
Pie Charts and When They Fail
Text solution
Check whether individuals belong to more than one categoryWhen players can check more than one bug on the same report, the category percentages overlap and add up to more than one full circle.
60%+50%+30%=140%>100%
Check whether each percentage comes from a different wholeEven though the platform crash rates add up to less than 100%, each percentage is a fraction of a separate group of players rather than parts of one single group.
12%8%5% of PC players, of PlayStation players, of Xbox players(three different totals)
Neither dataset can be shown with a pie chart, whereas a bar chart shows both cleanly because each bar stands on its own without needing to add up to 100%.
When a player belongs to more than one category, each bar still stands on its own while the pie slices push past a full circle and overlap.
5
The Area Principle and Broken Baselines
When we look at a graph, our eyes compare how much space each category takes up before reading the numbers on the axis. For a graph to be honest, it must follow the Area Principle: the area representing each category must be proportional to the value it represents.
Suppose Phone A runs apps without crashing 96% of the time and Phone B runs without crashing 92% of the time. Let's see how an advertisement for Phone A distorts this comparison by starting the vertical axis of its bar chart at 90% instead of 0%.
The Area Principle and Broken Baselines
Text solution
Compare full heights from a zero baselineWhen the vertical axis starts at 0%, the bar heights show the actual ratio of the two crash-free rates.
True height ratio=9296≈1.04
(bars are almost the same height)
Compare visible heights above the 90% cutoffStarting the axis at 90% cuts 90 units off the bottom of both bars, so the visible bars compare only the differences above 90%.
Visible height ratio=92−9096−90=26=3
(Phone A’s bar is 3 times as tall)
So cutting off the axis at 90% makes a 4-percentage-point difference look like Phone A is three times as reliable as Phone B.
Raising the baseline above zero cuts off the shared bottom of both bars, so their heights compare only what is left above the cutoff instead of the full `96%` and `92%`.
6
Misleading Pictographs
A chart can start at zero and still break the Area Principle if it replaces bars with pictures (pictographs) and scales their width along with their height.
Suppose coffee consumption at the studio doubles from 100 cups last month to 200 cups this month, and a designer shows this month's 200 cups by drawing a coffee cup icon twice as tall and twice as wide as last month's cup. We want to find how many times as large the second icon looks in 2D, and in 3D.
Misleading Pictographs and Lesson Summary
Text solution
Multiply the scale factors for a 2D pictureDoubling the height multiplies the icon's area by 2, and doubling the width multiplies it by 2 again.
Area multiple=height2×width2=4 times as large
Multiply all three scale factors for a 3D pictureDoubling the height, width, and depth of a 3D object multiplies its volume by 2 three times, once for each direction.
Volume multiple=height2×width2×depth2=8 times as large
So an amount that only doubled (200 vs. 100 cups) looks 4 times as large with a 2D icon scaled in both directions and 8 times as large with a 3D icon.
Widening a twice-as-tall cup to keep its normal shape keeps its height the same on the axis, while growing its area from two squares to four.
Key concepts
When working with categorical data (labels or groups), start by organizing the raw responses into counts and shares:
Use a frequency table when you want exact counts in one group (Lag=9), but switch to relative frequencies whenever you compare groups of different totals (209=45% vs. 1,00045=4.5%). When multiplying a rounded percentage by the total gives a decimal count (0.033×400=13.2), round to the nearest whole number (13 reports).
Choosing the right chart
A bar chart (with gaps between equal-width bars) works for any categorical data, whether plotted with counts or percentages. Sort the bars from tallest to shortest into a Pareto chart to show the ranking, unless the categories already have a natural order of their own (such as Small, Medium, Large). Use a pie chart only when every individual belongs to a single category of one whole totaling 100%; never use a pie chart when categories overlap (total>100%) or come from separate groups.
Checking if a graph is honest (The Area Principle)
Before trusting your eyes on a bar chart or pictograph, check two things: the vertical axis must start at 0 (starting at 90% turns 96% vs. 92% into a 6-to-2 height ratio), and every bar or icon must have the same width (scaling a picture's height and width by k multiplies its area by k2, and scaling a 3D icon in three dimensions multiplies its volume by k3).
7
Practice
1
A coffee shop records the size of the first 30 drinks ordered one morning: 15 Medium, 9 Large, and 6 Small. Find the relative frequency of each category as a percentage. Then explain why a different survey of 30 drinks with 10 of each size has rounded percentages (33.3% each) that add up to 99.9% instead of 100%.
Divide each size's count by the 30 total drinks. For the second survey, write each category's exact fraction before rounding to one decimal place.
In the second survey, each size has an exact share of 3010=31=33.333…%. (Watch out for the common mistake of thinking 99.9% means a drink was left out or the math is wrong.) Rounding each repeating decimal down to 33.3% leaves a tiny rounding error in each row, so the rounded numbers add up to 99.9% even though the exact fractions 31+31+31 add up to 100%.
2
Store A had 18 returned items out of 120 total sales today, while Store B had 45 returned items out of 900 total sales. A manager claims returns are a bigger issue at Store B because 45 is greater than 18. Use relative frequencies to check the manager's claim.
Find the return rate at each store separately by dividing that store's returned items by its own total sales.
Calculate the relative frequency of returns at each store using its own total sales (be careful not to compare the raw counts 45 and 18 directly, or divide by the combined total of 1,020 sales):
Store A:12018Store B:90045=0.15=15%=0.05=5%
The manager is wrong: returns make up 15% of sales at Store A compared to only 5% of sales at Store B, so returns are three times as large a share of sales at Store A.
3
A weekly summary report based on 300 customer support tickets lists only percentages: 15% were about passwords and 5.7% were about refunds. How many actual tickets were in each of those two categories?
Convert each percentage to a decimal and multiply by the 300 total tickets, keeping in mind what kind of number an actual ticket count must be.
Multiply each decimal share by the 300 total tickets:
(Don't leave the answer as 17.1 tickets, and don't multiply by 5.7 instead of 0.057 to get 1,710: because you cannot have a tenth of a support ticket, 17.1 comes from the table rounding 30017=5.666…% to 5.7%.) There were 45 password tickets and 17 refund tickets.
4
A student draws a bar chart of 200 survey responses across five movie genres using raw counts on the vertical axis, then redraws it using percentages on the vertical axis and sorts the bars from tallest to shortest. (a) How do the relative heights of the bars change when switching the vertical axis from counts to percentages? (b) Why must there be gaps between the bars? (c) What is this tallest-to-shortest bar chart called, and why would sorting tallest-to-shortest be a poor choice if the categories were T-shirt sizes (Small, Medium, Large, XL)?
Ask whether dividing every count by the same total (200) changes how the bars compare to one another, and compare categories that have a built-in order with categories that do not.
(a) The relative heights of the bars do not change at all; only the scale numbers on the vertical axis change (don't be fooled into thinking the bars shrink just because the axis labels go up to 100% instead of 200, since every bar is divided by the same total of 200). (b) Gaps show that the horizontal axis has separate categories rather than a continuous number line. (c) Sorting bars from tallest to shortest is called a Pareto chart. It works well for categories without a natural order like movie genres, but T-shirt sizes have a built-in order (Small, Medium, Large, XL) that would get mixed up if sorted by height.
5
For each dataset below, state whether it can be shown with a pie chart or needs a bar chart, and explain why: (a) The percentage of commuters who used a bus (55%), a train (45%), or a bicycle (25%) this week, where commuters checked all modes they used. (b) The percentage of freshmen (14%), sophomores (11%), juniors (9%), and seniors (6%) at a high school who belong to the robotics club. (c) A poll of 500 voters who each picked their single favorite season: Spring (30%), Summer (40%), Fall (20%), and Winter (10%).
For each case, check whether all percentages are shares of the same single group and whether each individual belongs to exactly one category so the shares add up to 100%.
(a) Bar chart only: commuters could check more than one mode of transit, so the categories overlap and the percentages add up to 55%+45%+25%=125%>100%. (b) Bar chart only: each percentage comes from a different whole (14% of all freshmen, 11% of all sophomores, and so on) rather than parts of one single group. (Avoid the common mistake of adding 14%+11%+9%+6%=40% and thinking you can make a pie chart by adding a 60% "other" slice; percentages from different totals cannot be combined into one circle.) (c) Pie chart (or bar chart): every voter belongs to exactly one category of a single whole (500 voters), and the slices add up to 30%+40%+20%+10%=100%.
6
Airline A has an on-time arrival rate of 88%, and Airline B has an on-time arrival rate of 82%. An advertisement for Airline A shows a bar chart with the vertical axis starting at 80% instead of 0%. How many times as tall is Airline A's bar compared to Airline B's bar in the advertisement, and what is the true ratio of their on-time rates?
With the vertical axis starting at 80%, subtract 80 from each rate to find the visible bar heights (don't just subtract the two rates 88−82=6).
Subtract the 80% cutoff from each airline's rate to find the visible height of each bar in the ad, then compare that ratio to the ratio of the full rates starting from 0%.
With the vertical axis starting at 80%, subtract 80 from each rate to find the visible bar heights (don't just subtract the two rates 88−82=6):
Visible height ratio=82−8088−80=28=4
Starting from 0%, divide the actual rates to find the true ratio:
True ratio=8288≈1.07
In the advertisement, Airline A's bar is 4 times as tall as Airline B's bar, whereas the true ratio of their on-time rates is about 1.07 (Airline A is only 6 percentage points, or about 7%, higher).
7
A recycling plant processed 100 tons of plastic in Year 1 and 300 tons in Year 2. (a) If a designer shows Year 2 by scaling a 2D recycling bin icon to be 3 times as tall and 3 times as wide as Year 1's icon, how many times as large is the second icon's area? (b) If the designer instead uses a 3D bin and triples its height, width, and depth, how many times as large is its volume? (c) How can the designer use bin icons to show Year 1 and Year 2 without breaking the Area Principle?
Multiply the height factor by the width factor (be careful not to add the dimensions as 3+3=6).
Multiply the scale factor of 3 for each dimension that changes, then think about how to show 300 tons using icons whose width never changes.
(a) Multiply the height factor by the width factor (be careful not to add the dimensions as 3+3=6):
Area multiple=3×3=9 times as large
(b) Multiply the scale factor across all three dimensions (don't just multiply 3×3=9 and forget the third dimension):
Volume multiple=3×3×3=27 times as large
(c) Keep the width the same by drawing one small bin icon for Year 1 (100 tons) and stacking three identical small bin icons of the same width on top of each other for Year 2 (300 tons).