By the end of this lesson, you should be able to
- Choose an appropriate graph for categorical versus quantitative variables.
- Describe shape, center, spread, and unusual observations.
- Explain why histogram bin width influences what a distribution appears to show.
A good graph can make a complicated dataset understandable in seconds. A bad graph can make a perfectly ordinary dataset look terrifying.
The numbers don’t get to object. That is our job.
Count categories with a bar chart
Imagine asking 100 commuters how they get to work. Forty say car, 30 bus, 20 train, and 10 bicycle. These are categorical observations. A bar chart is appropriate: each category gets its own bar, and the height represents a count or proportion.
Bars for distinct categories typically have gaps between them. Rearranging unordered categories does not change the underlying data.
For a quantitative variable such as commute time, a categorical bar chart is usually not the right choice. We care about numerical order, distance, and the distribution across intervals.
A histogram is not simply a bar chart with touching bars
A histogram partitions quantitative values into intervals called bins. Each observation falls into one bin. For equal-width bins, we can draw bar heights proportional to counts. For unequal-width bins, the area of each bar, not merely its height, must represent frequency.
The interval boundaries matter. Are scores of exactly 20 placed in the 10–20 bin or the 20–30 bin? A graph should use a consistent convention.
Most importantly, the choice of bin width can change the story a reader sees. Too few bins can hide structure; too many can emphasize random variation.
Describe what you actually see
When reading a distribution, look for four things:
- Shape: symmetric, right-skewed, left-skewed, single-peaked, or multimodal.
- Center: where a typical observation seems to fall.
- Spread: how widely values are dispersed.
- Unusual observations: gaps, clusters, or apparent outliers that might merit investigation.
Right-skew means a longer tail toward higher values, not necessarily that most observations are high. Income and waiting-time distributions often provide intuitive examples, though specific datasets must be examined rather than assumed to follow a particular shape.
The same data, many pictures
The laboratory uses a synthetic dataset, generated for instruction. Move the number of bins without changing a single observation. Watch which details become prominent. Then examine the frequency table, which includes the numerical counts that the visual representation might obscure.
Check your understanding
- Would you usually use a bar chart or histogram for students’ favorite subjects?
- Why is it risky to compare raw counts from groups of very different sizes?
- Can changing the number of histogram bins change the sample mean?
Suggested responses
- Bar chart: favorite subject is categorical. 2. A group with more observations can have a larger count even if a smaller proportion exhibits the property; proportions may be more informative. 3. No. Bin choices change the representation, not the values or the mean.
Unequal bins require density, not raw height
A histogram represents frequencies by rectangle areas. For equal-width bins, counts and heights differ only by a common scale. With unequal widths, raw count heights distort the comparison. A frequency-density height is count divided by bin width; a relative-frequency-density height additionally divides by total count, so all rectangle areas sum to one.
Suppose 20 synthetic waits contain 10 values in and 10 in . Counts are equal, but the first interval is half as wide. Relative density heights are and per minute. Both areas are . Equal count heights would imply twice as much area in the second interval and tell the wrong distributional story.
Specify endpoint conventions to prevent double counting. A common scheme uses left-closed, right-open intervals except the final bin includes its right endpoint. Also retain the original observations or an empirical cumulative distribution when possible: a histogram is a lossy summary whose appearance depends on width and origin.
Additional practice
- A bin of width 4 contains 8 of 40 observations. Find its relative-frequency-density height.
- Can two histograms from the same data have different apparent peaks?
- Why should a time plot retain chronological ordering rather than sort observations by value?
Worked additional solutions
- per input unit; the bin area is .
- Yes. Changing bins changes aggregation. Compare several defensible widths and inspect the raw or cumulative data before asserting multimodality.
- Sorting destroys temporal relationships, potentially hiding trends, seasonality, and dependence.
Same observations, different histograms
The dataset contains 32 invented waiting times in minutes. Changing the number of bins changes the shape of the graph, not the data.
Show frequency table and exact intervals
The intervals include the lower bound and exclude the upper bound, except that the last interval includes its upper bound.
| Waiting-time interval (minutes) | Count |
|---|
The quartiles use type-7 interpolation. They do not change with the bin count. This is a synthetic demonstration, not an empirical dataset.
Keep your place
Mark this lesson complete after you've read it, attempted its exercises, and explained its central idea in your own words.
Progress is not saved unless you choose to mark the lesson complete.
Saved only in this browser's local storage. No required account, server transmission, or analytics. You can reset your saved progress on the course page. Clearing browser data also clears the record.