hanegreefs.com/Statistics I
Chapter 3 of 10

Displaying and describing quantitative data

Frequency tables with bins, histograms and density histograms, shape (modes, symmetry, skewness, outliers), centre (mean and median), spread (range, IQR, mean absolute deviation, standard deviation), z-scores, the five-number summary, box plots and the 1.5 IQR outlier rule.

Textbook: Ch. 3 (without "Transforming skewed data") · Sessions: Module 3, lectures 3 to 5, tutorials 3 and 4 · About 70 minutes

Bins, histograms and density histogramsImportant

For a quantitative variable, first sort the values, then cut the number line into bins and count the cases in each bin. Decide what happens at a boundary: the course uses bins that are closed on the left and open on the right, written [a, b[. A histogram draws a bar per bin with a height equal to the count or the relative frequency. The bars touch, unless a bin is empty.

In a density histogram the area of a bar, not its height, equals the relative frequency of the bin. So the height is the density:

Formula
density = relative frequency / bin width
Worked example

A bar in a density histogram

Commute times of 22 students: 9 fall in the bin [20, 30[ minutes and 3 in the wider bin [40, 60[.

1

Relative frequencies

9/22 ≈ 40.9% and 3/22 ≈ 13.6%
2

Densities

40.9% / 10 min ≈ 4.09% per minute; 13.6% / 20 min ≈ 0.68% per minute
3

Check

area = height × width gives back 40.9% and 13.6%; all areas together make 100%
Answer

With unequal bins a plain count histogram would make the wide bin look important; the density histogram respects the area principle. The units of density are "% per minute".

Shape: modes, symmetry, skewness and outliersImportant

Describe a distribution by its shape, centre and spread, and mention anything unusual. For the shape, look at:

  • Modes: humps. Unimodal (one), bimodal (two, often a sign of two groups mixed together), multimodal, or uniform (no clear hump, all bars about equal).
  • Symmetry: the two halves around the centre mirror each other. Otherwise the distribution is skewed to the side of the longer tail: skewed right (long tail of high values, typical for incomes and prices) or skewed left.
  • Outliers and gaps: values that stand apart from the rest. Always investigate them; never delete them silently.

Centre: mean and medianImportant

Formula
mean x̄ = (sum of the values) / n

The median is the middle value of the sorted data (the average of the two middle values when n is even): about half of the values lie below it, and in a histogram it splits the area in two equal halves. The mean is the balance point of the histogram.

The median is resistant: outliers and a long tail hardly move it. The mean is pulled toward the tail. Hence: skewed right means mean > median, skewed left means mean < median, and for a symmetric distribution they are about equal. Report the median and the IQR for skewed data, the mean and the standard deviation for roughly symmetric data.

Spread: range, IQR, MAD and standard deviationImportant

The range = max − min depends only on the two extremes, so it is not resistant. The quartiles split the sorted data in four: Q1 is the median of the lower half and Q3 the median of the upper half (with n odd, the median itself is left out of both halves, as on the TI-84). The interquartile range IQR = Q3 − Q1 covers the middle 50% and is resistant.

Deviations from the mean, x − x̄, always add up to zero, so their plain average is useless. Two ways remove the minus signs: the mean absolute deviation (average of |x − x̄|) and the standard deviation, the quadratic mean (root-mean-square) of the deviations with n − 1 in the denominator:

Formula
s2 = Σ(x − x̄)2 / (n − 1) (the variance, in squared units)s = √( Σ(x − x̄)2 / (n − 1) ) (same units as the data)
Worked example

Four prices by hand

Prices of 4, 6, 9 and 13 euro.

1

Mean

(4 + 6 + 9 + 13)/4 = 32/4 = 8 euro
2

Deviations

−4, −2, 1 and 5 euro; their sum is 0
3

Mean absolute deviation

(4 + 2 + 1 + 5)/4 = 3 euro
4

Squared deviations

16 + 4 + 1 + 25 = 46 euro2; variance 46/3 ≈ 15.33 euro2
5

Standard deviation

s = √15.33 ≈ 3.92 euro
Answer

The prices typically lie about 3.92 euro from their mean of 8 euro. Read a formula from the inside out: deviations, squares, mean, square root.

Whatever the shape, most values lie within three standard deviations of the mean: by Chebyshev's inequality at most 1/k2 of the values lie more than k SDs away, so at most 1/9 lie beyond 3 SDs.

z-scoresImportant

Formula
z = (x − x̄) / s

A z-score says how many standard deviations a value lies above (z > 0) or below (z < 0) the mean. It has no unit, so it lets you compare values measured on different scales. Standardising shifts the mean to 0 and the standard deviation to 1 without changing the shape.

Common trapUnits cancel in a z-score: (340 euro − 300 euro)/20 euro = 2, with no unit. Writing "2 euro" is wrong.

Five-number summary, box plots and outliersImportant

The five-number summary is min, Q1, median, Q3, max (R: summary(x); TI-84: 1-Var Stats). A box plot draws a box from Q1 to Q3 with a line at the median, and whiskers that run to the most extreme values that are not outliers. A value is flagged as an outlier when it lies below Q1 − 1.5 IQR or above Q3 + 1.5 IQR. Side-by-side box plots compare the centre and spread of groups at a glance.

Worked example

Weekly hours of nine student jobs

Hours: 12, 15, 15, 18, 20, 22, 25, 30, 58.

1

Centre

mean = 215/9 ≈ 23.9 h; median = 20 h (the fifth value)
2

Quartiles

lower half 12, 15, 15, 18 gives Q1 = 15 h; upper half 22, 25, 30, 58 gives Q3 = 27.5 h; IQR = 12.5 h
3

Fences

15 − 1.5 × 12.5 = −3.75 h and 27.5 + 18.75 = 46.25 h
4

Outlier

58 h lies above 46.25 h, so it is an outlier
5

Spread and z

s ≈ 13.9 h; z of 58 h ≈ (58 − 23.9)/13.9 ≈ 2.45
Answer

The mean lies above the median: the distribution is skewed right by the 58-hour job. The median of 20 h and IQR of 12.5 h describe a typical job better. The descriptive statistics lab redoes this for any data.

Key takeaways

  • Describe shape, centre and spread, and mention outliers.
  • Density histogram: area = relative frequency, height = relative frequency / width.
  • Skewed right: mean > median; use median and IQR for skewed data.
  • s = √(Σ(x − x̄)2/(n − 1)), in the units of the data.
  • z = (x − x̄)/s counts standard deviations from the mean.
  • Outliers: below Q1 − 1.5 IQR or above Q3 + 1.5 IQR.

Loading cards
Question
Click, tap or press space to flip
Answer

Multiple choice (10)

Question 1 · Chapter 3

Ten wire diameters (cm): 0.481, 0.522, 0.515, 0.499, 0.553, 0.547, 0.507, 0.550, 0.539, 0.518. The mean is...

Why: The sum is 5.231 cm; divide by 10.
Question 2 · Chapter 3

A five-number summary is 21, 38, 45, 49, 67 and the mean is 38.5. The shape is most likely...

Why: The mean lies well below the median.
Question 3 · Chapter 3

The largest salary in a data set rises from 120,000 to 160,000. What changes?

Why: Mean and range use the maximum; median and IQR do not.
Question 4 · Chapter 3

A value has z = −1.5. This means...

Why: z counts standard deviations.
Question 5 · Chapter 3

Q1 = 40 and Q3 = 60. Which value is an outlier?

Why: The fences are 10 and 90.
Question 6 · Chapter 3

In a density histogram a bin [10, 15[ has density 4% per unit. Its relative frequency is...

Why: Area = 4% × 5 = 20%.
Question 7 · Chapter 3

The variance of a set of prices in euro is measured in...

Why: Squared deviations have squared units.
Question 8 · Chapter 3

For a strongly right-skewed income distribution the best summaries are...

Why: Resistant measures suit skewed data.
Question 9 · Chapter 3

Deviations from the mean of any data set add up to...

Why: Positive and negative deviations cancel.
Question 10 · Chapter 3

Removing a far outlier from a data set will most likely...

Why: The SD is sensitive to extreme values.

Exam-style open questions (3)

Open question · Chapter 3

Summarise a small data set

Monthly phone bills (euro): 18, 22, 25, 25, 27, 30, 34, 75. Give the five-number summary, check for outliers and choose suitable summaries.

Show the worked outline
  • Sorted, n = 8. Median = (25 + 27)/2 = 26 euro.
  • Lower half 18, 22, 25, 25: Q1 = 23.5; upper half 27, 30, 34, 75: Q3 = 32; IQR = 8.5 euro.
  • Upper fence 32 + 12.75 = 44.75: 75 euro is an outlier. Mean = 256/8 = 32 euro, pulled up by it.
  • Report the median (26 euro) and IQR (8.5 euro), and mention the outlier.
Open question · Chapter 3

Compare with z-scores

A student scores 72 on a statistics test (mean 60, SD 8) and 81 on a law test (mean 75, SD 5). On which test did the student do relatively better?

Show the worked outline
  • Statistics: z = (72 − 60)/8 = 1.5.
  • Law: z = (81 − 75)/5 = 1.2.
  • Relative to the class the statistics score is better, although the law score is higher in points.
Open question · Chapter 3

Standard deviation by hand

Compute the mean and standard deviation of 10, 12, 14, 20 kg, with all intermediate steps.

Show the worked outline
  • Mean = 56/4 = 14 kg; deviations −4, −2, 0, 6 kg.
  • Squares 16 + 4 + 0 + 36 = 56 kg2; variance 56/3 ≈ 18.67 kg2.
  • s ≈ 4.32 kg.

LabDescriptive statistics lab

The default data are the student job example; the second data set redoes the four prices by hand.

LabDensity histogram lab

Switch to unequal bins to see why densities matter.