Changing What the Vertical Axis Means
In Reading Counts and Percents From a Histogram, you used bar heights to find counts in bins and percentages in ranges. A frequency histogram’s vertical axis shows counts. But when we want to compare distributions from samples of different sizes, counts can be difficult to compare: a larger sample may have higher bars simply because it contains more observations. A relative frequency histogram changes the vertical axis so that each bar represents a share of the sample instead.
For equal-width bins, convert each count to a relative frequency by dividing by the total number of observations. The bin intervals do not change, and the bars still touch. What changes is the meaning and scale of the vertical axis. A relative frequency can be displayed as a proportion, such as 0.25, or as a percentage, such as 25%.
A relative frequency histogram can make comparisons between samples of different sizes more meaningful. It describes how the observations are distributed within each sample, rather than how many observations each sample contains. The bars’ widths and locations still show the quantitative intervals, as in the earlier tutorials on constructing and reading histograms.
Convert Counts to Relative Frequencies
If a bin contains \(f\) observations out of a total of \(n\), its relative frequency is \(f/n\). To show that share as a percentage, multiply by \(100\%\). Apply the calculation separately to every bin, using the same total \(n\) each time.
For example, if 12 of 48 observations fall in a bin, its relative frequency is \(12/48=0.25\), or 25%. Across all bins, the counts add to \(n\), so the relative frequencies add to \(n/n=1\). If the displayed values do not add to exactly 1, check the arithmetic and consider whether rounded values explain a small difference.
For equal-width bins, the relative frequency is the bar’s height on a relative frequency axis. Do not divide by the bin width as well: the bin widths are the same, and the vertical axis is intended to give each bin’s share directly. The bin width becomes essential when bins have different widths.
Worked Example: Convert an Equal-Width Histogram
Worked Example: Convert an Equal-Width Histogram
A fictional community garden records how many minutes 40 volunteers spend watering plants during one session. A frequency histogram has equal-width 5-minute bins with these frequencies: 6 for \([0,5)\), 14 for \([5,10)\), 12 for \([10,15)\), and 8 for \([15,20)\). Convert it to a relative frequency histogram, using proportions.
Use the same denominator for each bin. There are \(n=40\) volunteers. Divide each frequency by 40:
| Watering time (minutes) | Frequency | Relative frequency |
|---|---|---|
| [0, 5) | 6 | 6/40 = 0.15 |
| [5, 10) | 14 | 14/40 = 0.35 |
| [10, 15) | 12 | 12/40 = 0.30 |
| [15, 20) | 8 | 8/40 = 0.20 |
| Total | 40 | 1.00 |
Change the vertical axis. Keep the same four intervals and the same touching bars, but make their heights 0.15, 0.35, 0.30, and 0.20. Label the vertical axis “Relative frequency.” The heights could instead be shown as 15%, 35%, 30%, and 20%, with an axis labeled “Relative frequency (percent).”
Check the conversion. The frequencies sum to \(6+14+12+8=40\), and the relative frequencies sum to \(0.15+0.35+0.30+0.20=1.00\). The largest bar is still the \([5,10)\) bin. In context, 35% of these 40 volunteers watered for at least 5 but less than 10 minutes.
Why Different Bin Widths Need Density
When bins have different widths, a bar’s height cannot simply be the bin’s relative frequency if we want the area of each bar to represent the bin’s share. A wider bar would have more area than a narrower bar at the same height. That would make area comparisons misleading: the visual area would reflect both the share and the width.
A density histogram adjusts the vertical axis for bin width. Its vertical scale is density, measured in relative frequency per unit of the quantitative variable. Divide a bin’s relative frequency by its width to get its density. Then the bar’s area—height multiplied by width—equals the bin’s relative frequency.
The width’s unit matters. If the variable is time measured in minutes, density is in relative frequency per minute. A density value is not itself a proportion or a percentage, and it can be greater than 1. The area, not the height alone, gives the proportion. When every bin has the same width, using density still makes area equal relative frequency, but the heights are a common constant multiple of the relative frequencies. In introductory comparisons with equal-width bins, a relative frequency histogram uses the relative frequencies themselves as heights; a density histogram is especially useful when widths differ.
The total area of a density histogram is 1 because the relative frequencies of all bins add to 1. If the vertical scale is defined in percentage per unit instead, the total area is 100%. Be clear about which scale is being used.
Worked Example: Calculate Densities for Unequal Bins
Worked Example: Calculate Densities for Unequal Bins
A fictional water-monitoring team records the nitrate concentration, in milligrams per liter, in 48 water samples. A histogram uses the bins \([0,10)\), \([10,30)\), and \([30,40)\), with frequencies 12, 18, and 18. Convert the bin frequencies to a density histogram and explain what the bar areas show.
Find each bin’s width and relative frequency. The widths are 10, 20, and 10 milligrams per liter. The relative frequencies are \(12/48=0.25\), \(18/48=0.375\), and \(18/48=0.375\). They add to 1.
Divide relative frequency by width. For the first bin, the density is \(0.25/10=0.025\) per milligram per liter. For the second, it is \(0.375/20=0.01875\) per milligram per liter. For the third, it is \(0.375/10=0.0375\) per milligram per liter. Equivalently, calculating directly from the counts gives \(12/(48\times10)=0.025\), \(18/(48\times20)=0.01875\), and \(18/(48\times10)=0.0375\).
Check the areas. Multiply each density by its bin width: \(0.025\times10=0.25\), \(0.01875\times20=0.375\), and \(0.0375\times10=0.375\). These areas match the relative frequencies. Together they give \(0.25+0.375+0.375=1\).
The second and third bins each contain 37.5% of the samples, even though their density heights differ. The second bin is twice as wide, so its lower bar has the same area as the narrower, taller third bar. A density histogram must be read by area to find a bin’s share.
Compare Samples With Relative Frequency Histograms
A relative frequency histogram is useful when samples have different totals and share the same quantitative variable and bin boundaries. Because each sample’s bin counts are divided by that sample’s own total, the resulting heights compare proportions rather than raw sample sizes. This is a descriptive comparison; the graph alone does not establish why distributions differ.
Worked Example: Compare Distributions, Not Sample Sizes
Worked Example: Compare Distributions, Not Sample Sizes
Two fictional after-school programs record how long students spend on a reading activity. The first program has 40 students, with counts 8, 20, and 12 in equal-width bins \([0,10)\), \([10,20)\), and \([20,30)\) minutes. The second has 80 students, with counts 16, 40, and 24 in those same bins. Compare the frequency and relative frequency histograms.
Convert each program separately. For the first program, the relative frequencies are \(8/40=0.20\), \(20/40=0.50\), and \(12/40=0.30\). For the second, they are \(16/80=0.20\), \(40/80=0.50\), and \(24/80=0.30\). Each set sums to 1.
Explain what the axes show. In frequency histograms, the second program’s bar heights are twice the first program’s heights because its counts are twice as large. In relative frequency histograms, corresponding bars have identical heights: 0.20, 0.50, and 0.30. Both samples have the same proportions in the displayed bins, although the second includes more students.
State the comparison in context. In each program, 50% of students spent at least 10 but less than 20 minutes on the reading activity. The relative frequency histograms show the same distribution across these bins; the frequency histograms show different numbers of students. The matching proportions describe these samples and do not, on their own, prove that the programs’ underlying populations have identical distributions.
A Reliable Conversion Process
Before changing a histogram’s vertical scale, identify what the bars are meant to communicate and whether the bins have equal widths. Keep the bin boundaries fixed during a conversion. For equal-width bins, use relative frequency as the bar height when making a relative frequency histogram. For unequal-width bins, use density so that area, not height alone, represents each bin’s share.
Check that the frequencies across all bins add to the total number of observations.
For a relative frequency histogram, divide each count by the total. If bin widths differ and bar area should represent share, use density.
For density, divide each relative frequency by that bin’s width. Include the appropriate units on the vertical axis.
Relative frequencies should sum to 1. For a density histogram, multiply each height by its width; the bar areas should equal the relative frequencies and add to 1.
The vertical axis has to match the calculation. A count axis answers “how many observations?” A relative frequency axis answers “what proportion of the sample?” A density axis accounts for both proportion and bin width so that bar area answers the proportion question.
Common Mistakes and AP Exam Tips
- Dividing by the wrong total. To find a bin’s relative frequency, use the total number of observations represented by the whole histogram, not the frequency of a neighboring bin or a selected range.
- Confusing a percentage with a density. A relative frequency of 0.30 means 30% of the observations are in that bin. A density of 0.03 per unit is a height; multiply it by the bin width to get the bin’s share.
- Using relative frequency as height for unequal-width bins. If widths differ, this makes bar areas unequal to the bins’ relative frequencies. Calculate density when area should represent share.
- Comparing frequency heights across samples of different sizes. Higher counts may simply come from a larger sample. Compare relative frequencies when the question concerns how the distributions are shaped, and state the sample context.
- Leaving units off a density axis. Density is relative frequency per unit of the variable. For concentration measured in milligrams per liter, the density scale is per milligram per liter.
- Expecting density heights to sum to 1. It is the total area that equals 1 in a density histogram. The heights alone need not sum to 1, especially when widths differ.
For a full-credit response, show the denominator used for relative frequencies, label the vertical axis correctly, and explain what a bar’s height or area represents. With unequal bin widths, show at least one density calculation and verify that density times width gives the bin’s relative frequency.
Check Your Understanding
Use the full sample total for relative frequencies. For density histograms, remember that a bar’s area equals its relative frequency.
- A bin contains 15 of 60 observations. What is its relative frequency as a proportion and as a percentage?
- Four equal-width bins have relative frequencies 0.10, 0.25, 0.40, and 0.25. What should their bar heights be on a relative frequency axis, and what should their heights add to?
- A bin has relative frequency 0.30 and width 6 units. What is its density, and what is its bar area?
- Why can’t relative frequency alone be used as bar height to make area represent share when bin widths differ?
- Two samples have different sizes but identical relative frequencies in matching bins. What does that say about their observed distributions, and what does it not prove?