Data and Displays

Study Sheet

Data and Displays

Kinds of data and the pictures that fit them

Categorical and Quantitative

Concept
Two kinds of data

A variable is categorical when it sorts things into groups (eye color, favorite sport) and quantitative when it measures an amount (height, test score). The kind of data decides the kind of picture: bar charts and pie charts for categories; dot plots, histograms and box plots for numbers.

The distinction matters because arithmetic only makes sense for quantitative data. The "average zip code" of a class is a number you can compute and it means nothing. Before summarizing anything, ask: would adding two of these values together make sense? If not, the data is categorical, and counts and percentages are the only honest summaries.

Example
Choosing a display

A survey records each student's pet type and the number of hours of sleep. Pet type is categorical: the natural picture is a bar chart of counts, one bar per category, in any order. Hours of sleep is quantitative: a dot plot or histogram, whose horizontal axis is a number line, shows the shape of the distribution — where the values cluster and how far they spread.

Example
Counts to percentages
dog12cat9fish4none5students
One bar per category; the gaps between bars signal that the categories have no numerical order.

In a class of 3030, the pets are: dog 1212, cat 99, fish 44, none 55. Relative frequencies divide by the total: 12/30=40%12/30 = 40\%, 9/30=30%9/30 = 30\%, 4/30≈13.3%4/30 \approx 13.3\%, 5/30≈16.7%5/30 \approx 16.7\%, which add to 100%100\%. For a pie chart, each percentage of 360°360°: 144°144°, 108°108°, 48°48°, 60°60°. The bar chart shows the same comparison, and it is easier to read — lengths are judged more accurately than angles.

Side note
Where it goes wrong

Treating a number that is really a label as quantitative — jersey numbers, ID numbers, zip codes — or treating a rating like "1 to 5 stars" as if the gaps between stars were equal amounts. A "mean jersey number" of 14.214.2 is arithmetic without meaning.

Try it
Try it: classify

Classify each as categorical or quantitative: (a) blood type, (b) number of siblings, (c) commute time, (d) car color.

Show the answer

(a) categorical, (b) quantitative (a count — adding siblings makes sense), (c) quantitative (a measured amount), (d) categorical.

Dot Plots and Stem-and-Leaf Plots

Concept
Every value visible

For a small quantitative data set, a dot plot puts one dot per value above a number line, stacking repeats. A stem-and-leaf plot splits each value into a stem (leading digits) and a leaf (last digit) and lists the leaves beside their stem. Both keep every data value while showing the shape: center, spread, clusters, gaps and outliers.

These displays are histograms that forgot nothing: the height of each stack or row is a count, so the shape is visible, and yet the actual values can still be read off to compute a median or a range. They stop working once there are hundreds of values; then the histogram, which only keeps counts per bin, takes over. The axis must be an honest number line, with equal spacing for equal differences, or the shape is a lie.

Example
Reading a dot plot
012345678910median 8
Stacks show the counts; the lone 3 on the left is the long tail.

Fifteen quiz scores (out of 1010): 3,6,7,7,7,8,8,8,8,9,9,9,10,10,103, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10. The plot shows a peak at 88, most scores from 77 to 1010, and one score of 33 far to the left with a gap before it — a possible outlier. The distribution is skewed LEFT: the long tail points toward low scores. The median is the 88th value, 88; the mean is 119/15≈7.93119/15 \approx 7.93, pulled slightly below the median by the tail.

Example
A stem-and-leaf plot

Resting pulse rates of 1212 people: 58,62,64,64,67,70,71,73,73,76,82,9558, 62, 64, 64, 67, 70, 71, 73, 73, 76, 82, 95. Stems are the tens digits, leaves the units:

5862 4 4 770 1 3 3 68295\begin{array}{r|l} 5 & 8 \\ 6 & 2~4~4~7 \\ 7 & 0~1~3~3~6 \\ 8 & 2 \\ 9 & 5 \end{array}

With n=12n = 12 the median is the average of the 66th and 77th values: (70+71)/2=70.5(70 + 71)/2 = 70.5. The range is 95−58=3795 - 58 = 37, and the 9595 stands apart from the rest.

Side note
Where it goes wrong

Leaving values off the axis. A dot plot of pulse rates drawn with only the values that occur — 58,62,64,…,82,9558, 62, 64, \ldots, 82, 95 equally spaced — puts 8282 and 9595 side by side and hides the gap between them. The axis must include the empty stretches; likewise a stem plot keeps empty stems (a stem 88 with no leaves stays in the list).

Try it
Try it: read the stems

A stem-and-leaf plot has rows 3∣1 53 \mid 1~5,  4∣0 2 2 7\ 4 \mid 0~2~2~7,  5∣3 8\ 5 \mid 3~8. Find the median, the mode and the range.

Show the answer

The values are 31,35,40,42,42,47,53,5831, 35, 40, 42, 42, 47, 53, 58 (n=8n = 8). Median =(42+42)/2=42= (42 + 42)/2 = \mathbf{42}; mode 42\mathbf{42}; range 58−31=2758 - 31 = \mathbf{27}.

Histograms and Shape

Concept
Reading a histogram

A histogram groups values into equal-width bins and draws a bar whose height is the count in each bin. Look for the shape: symmetric, skewed right (a long tail to the right), or skewed left; one peak or two; any gaps or outliers.

Shape is the first thing to report because it decides which summaries are meaningful later. A skewed distribution — incomes, house prices, waiting times — has a mean pulled toward the tail and a median that stays put, so the two disagree, and the direction of the disagreement tells you the direction of the skew. Unlike a bar chart, the bars of a histogram touch: the bins cover a continuous number line.

Example
Reading counts from bins
25963101020304050602468commute time (minutes)
A single peak at 20–29 minutes with a longer tail to the right.

Commute times (minutes) for 2626 workers are binned 00–99: 22, 1010–1919: 55, 2020–2929: 99, 3030–3939: 66, 4040–4949: 33, 5050–5959: 11. How many take 3030 minutes or more? 6+3+1=106 + 3 + 1 = 10 of 2626, about 38%38\%. Where is the median? It is between the 1313th and 1414th values; the running totals are 2,7,16,…2, 7, 16, \ldots, so both lie in the 2020–2929 bin. The histogram cannot say more precisely — binning discarded the exact values.

Example
Estimating the mean from bins

For the commute data, treat each value as its bin midpoint: 4.5⋅2+14.5⋅5+24.5⋅9+34.5⋅6+44.5⋅3+54.5⋅126=69726≈26.8\dfrac{4.5\cdot2 + 14.5\cdot5 + 24.5\cdot9 + 34.5\cdot6 + 44.5\cdot3 + 54.5\cdot1}{26} = \dfrac{697}{26} \approx 26.8 minutes. It is an estimate, because the true values within a bin are unknown; it lands to the right of the peak, as the tail on the right predicts.

Tip
Skew points to the tail

Skewed right means the long tail is on the right (a few large values). For right-skewed data, mean>median\text{mean} > \text{median}. For left-skewed data, mean<median\text{mean} < \text{median}.

Example
Bin widths change the picture

The same 4040 values shown with bins of width 55 look jagged; with width 2020, two bars hide everything. Choose bins so that the shape is visible without being noise — usually 55 to 1515 bins.

Side note
Where it goes wrong

Unequal bins drawn as if equal. If the commute data merged 4040–5959 into one bin of width 2020 with count 44, drawing that bar at height 44 doubles its visual weight. Area, not height, should show the count, so a bin twice as wide needs half the height. Keep bins equal and the problem never arises.

Try it
Try it: read the shape

A histogram of household incomes has most bars on the left and a long thin tail to the right. Which is larger, the mean or the median?

Show the answer

The distribution is skewed right. The few very high incomes in the tail pull the mean above the median, while the median, which depends only on the middle position, barely moves.

Why It Works

The mean is the balance point of the data: it is the unique value mm for which the deviations xi−mx_i - m sum to zero. A single far-out value contributes a huge deviation, so the balance point must slide toward it to compensate. The median, defined by position alone, does not feel how far away the extreme value is — only that it is on one side. That is the whole reason the two disagree exactly when a distribution is skewed.