Data sets and distributions

Print the chapter

Every lesson of the chapter, ready for paper. Exercise sets are lettered A, B, C… and answered at the end.

To save a PDF, choose “Save as PDF” in the print dialog.

1. Cases and variables: categorical and quantitative

Warm-up

Three quick questions from earlier lessons.

Discover

A spreadsheet has one row per student and columns for age, favorite color and number of pets. Which column holds categorical data?

  1. Favorite color
  2. Number of pets

Key idea

Data are values of variables recorded on cases.

Cases (individuals) are what the data describe; variables are what is recorded. A categorical variable places cases in groups; a quantitative variable takes numerical values for which arithmetic makes sense (discrete counts or continuous measurements).

Worked example

A café records each order: drink size (S, M, L), price in dollars, and table number.

Cases: the orders
Each row is an order.
Price: quantitative
Price: averaging makes sense.
Size and table number: categorical
Table numbers are labels; size is a category.

Your turn, guided

Your turn: how many quantitative variables among height, jersey number, goals scored?

22
Height and goals; jersey numbers are labels.

Practice ★

  1. A survey of 23 students records the following. Tick all the categorical variables.
    1. Eye color
    2. ZIP code
    3. Takes the bus to school (yes/no)
    4. Height in cm
    5. Number of siblings
  2. A survey of 80 students records the following. Tick all the categorical variables.
    1. Eye color
    2. ZIP code
    3. Takes the bus to school (yes/no)
    4. Height in cm
    5. Number of siblings

Watch out!

Practice ★★

  1. Area codes such as 770 are numbers. Is the area code of a phone number a quantitative variable?
    1. No: it is categorical, a label that only looks like a number
    2. Yes: its values are numbers
    3. Yes, a discrete quantitative variable
  1. A study measures the resting heart rate of 29 runners. What are the cases (observational units)?
    1. The 29 runners
    2. The heart rates
    3. The number 29

Exit ticket

Three questions to check you have got it.

  1. A survey of 23 students records the following. Tick all the categorical variables.
    1. Eye color
    2. ZIP code
    3. Takes the bus to school (yes/no)
    4. Height in cm
    5. Number of siblings
  2. A survey of 80 students records the following. Tick all the categorical variables.
    1. Eye color
    2. ZIP code
    3. Takes the bus to school (yes/no)
    4. Height in cm
    5. Number of siblings
  3. A survey of 54 students records the following. Tick all the categorical variables.
    1. Eye color
    2. ZIP code
    3. Takes the bus to school (yes/no)
    4. Height in cm
    5. Number of siblings

Summary card

Variables

  • Cases: who or what. Variables: what is recorded.
  • Categorical: groups. Quantitative: meaningful numbers.

Watch out: numeric codes (ZIP, ID) are categorical.

2. Displaying and describing distributions

Warm-up

Three quick questions from earlier lessons.

Discover

House prices in a town: most around 300 thousand dollars, a few mansions above 2 million dollars. Which is pulled up by the mansions?

  1. The mean
  2. The median

Key idea

Describe a distribution by its shape, center, spread and unusual values.

Shape: symmetric, skewed right (long tail of high values) or skewed left; number of peaks. Center: mean or median. Spread: SD, IQR or range. Outliers: values far from the rest. In a right-skewed distribution the mean is usually above the median.

Worked example

Commute times: median 22 min, mean 29 min, a few 90-min commutes.

Mean > median
The mean is pulled towards the long tail.
Skewed right
The tail is on the high side.
The median describes a typical commute better
Resistant to the tail.

Your turn, guided

Your turn: test scores have mean 61 and median 70. How far below the median is the mean?

99 points: skewed left
70 − 61: the mean is pulled down by a tail of low scores, so the distribution is skewed left.

Practice ★

  1. A distribution of incomes has mean 54 thousand dollars and median 43 thousand dollars. What is its most likely shape?
    1. Skewed right: a long tail of high values pulls the mean up
    2. Skewed left
    3. Symmetric
  2. A distribution of incomes has mean 59 thousand dollars and median 54 thousand dollars. What is its most likely shape?
    1. Skewed right: a long tail of high values pulls the mean up
    2. Skewed left
    3. Symmetric
  1. 43 students name their favorite sport. Which display suits these data?
    1. A bar chart
    2. A histogram
    3. A boxplot

Watch out!

Practice ★★

  1. Which four features should you describe for the distribution of a quantitative variable (here, 42 test scores)?
    1. Shape, center, spread and unusual values (outliers)
    2. The mean, the median, the mode and the sample size
    3. The type of graph, the title, the axes and the colors

Exit ticket

Three questions to check you have got it.

  1. A distribution of incomes has mean 54 thousand dollars and median 43 thousand dollars. What is its most likely shape?
    1. Skewed right: a long tail of high values pulls the mean up
    2. Skewed left
    3. Symmetric
  2. A distribution of incomes has mean 59 thousand dollars and median 54 thousand dollars. What is its most likely shape?
    1. Skewed right: a long tail of high values pulls the mean up
    2. Skewed left
    3. Symmetric
  3. A distribution of incomes has mean 58 thousand dollars and median 46 thousand dollars. What is its most likely shape?
    1. Skewed right: a long tail of high values pulls the mean up
    2. Skewed left
    3. Symmetric

Summary card

Describing a distribution

Shape, center, spread, outliers, in context.

Watch out: skewed right means mean > median (usually).

3. Reading and interpreting circle graphs

Warm-up

Three quick questions from earlier lessons.

Discover

In a circle graph, a sector takes up half of the circle. What percent of the data is it?

  1. 50%
  2. 180%

Key idea

A circle graph shows parts of one whole.

Each sector is a percent of the whole, and the whole circle is 100% (or 360°). To find a count, take that percent of the total. To find a sector's angle, take that percent of 360°.

Worked example

40 students; the music sector is 25%.

25% of 40 = 10 students
Count.
25% of 360° = 90°
Angle.

Your turn, guided

Your turn: 60 people, a sector of 10%. How many people?

66
10% of 60.

Practice ★

  1. A circle graph shows the favorite sports of 240 students. The soccer sector is labeled 15%. How many students chose soccer?
  2. A circle graph shows the favorite sports of 60 students. The soccer sector is labeled 40%. How many students chose soccer?
  1. A circle graph shows how 160 students get to school: bus 50%, walk 25%, car 25%. Which statement is true?
    1. Twice as many students take the bus as walk
    2. 50 students take the bus
    3. The sectors add up to 360 students

Watch out!

Practice ★★

  1. A category is 10% of a circle graph. What is the angle of its sector, in degrees?
  2. A category is 45% of a circle graph. What is the angle of its sector, in degrees?
  1. A circle graph shows the favorite sports of 240 students. The soccer sector is labeled 15%. How many students chose soccer?

Exit ticket

Three questions to check you have got it.

  1. A circle graph shows the favorite sports of 240 students. The soccer sector is labeled 15%. How many students chose soccer?
  2. A circle graph shows the favorite sports of 60 students. The soccer sector is labeled 40%. How many students chose soccer?
  3. A circle graph shows the favorite sports of 40 students. The soccer sector is labeled 35%. How many students chose soccer?

Summary card

Circle graphs

Count = percent × total; angle = percent × 360°.

Watch out: a percent is not a count.

4. Measures of center: mean and median

Warm-up

Three quick questions from earlier lessons.

Discover

Five friends earn 10, 12, 13, 15 and 150 dollars an hour. Which number describes a typical friend better?

  1. The median, 13 dollars
  2. The mean, 40 dollars

Key idea

Two ways to measure the center.

Mean xˉ=∑xin\bar{x} = \dfrac{\sum x_i}{n}: the balance point; sensitive to extremes. Median: the middle value of the ordered data (with an even count, the average of the two middle values); resistant to extremes.

Worked example

Data: 4, 7, 7, 9, 13, 20.

Mean =10= 10
Sum 60, six values.
Median =8= 8
Middle values 7 and 9.
Mean > median: slight right skew
The 20 pulls the mean up.

Your turn, guided

Your turn: the median of 3, 8, 10, 15.

99
(8 + 10)/2.

Practice ★

  1. Find the mean of the data 5, 11, 24, 33, 41.
  2. Find the mean of the data 3, 11, 20, 38, 65.
  3. Find the mean of the data 9, 19, 24, 39, 68.

Watch out!

Practice ★★

  1. Find the median of the data 9, 14, 24, 37, 44, 79.
  2. Find the median of the data 2, 10, 28, 36, 43, 64.
  1. One value in a data set is changed from 20 to 712. What happens to the mean and the median?
    1. The mean increases; the median stays about the same
    2. Both increase by the same amount
    3. The median increases; the mean stays the same

Exit ticket

Three questions to check you have got it.

  1. Find the median of the data 9, 14, 24, 37, 44, 79.
  2. Find the median of the data 2, 10, 28, 36, 43, 64.
  3. Find the median of the data 8, 18, 26, 32, 43, 97.

Summary card

Center

  • Mean: sum ÷ n; pulled by extremes.
  • Median: middle value; resistant.

Watch out: even count: average the two middle values.

5. Mean and mean absolute deviation (MAD)

Warm-up

Three quick questions from earlier lessons.

Discover

Two players both average 10 points a game. One scores 9, 10, 11; the other 0, 10, 20. Who is more consistent?

  1. The first player
  2. Both: the means are equal

Key idea

The MAD measures spread around the mean.

The mean is the sum ÷ the count (the balance point). The mean absolute deviation (MAD) is the average distance of the values from the mean: find each distance (always positive), then average them. A larger MAD means more variability.

Worked example

Data 2, 4, 6, 8.

Mean 5
Sum 20 ÷ 4.
3, 1, 1, 3
Distances.
MAD = 2
Average.

Your turn, guided

Your turn: the mean of 3, 7, 8.

66
18 ÷ 3.

Practice ★

  1. The mean of 4 numbers is 15. What is their sum?
  2. The mean of 7 numbers is 20. What is their sum?
  1. Two classes both have a mean test score of 61. Class A has a MAD of 3 points and class B a MAD of 7 points. Which statement is true?
    1. Class B's scores are more spread out
    2. Class A's scores are more spread out
    3. The scores are equally spread, because the means are equal

Watch out!

Practice ★★

  1. Find the mean absolute deviation (MAD) of the data 8, 13, 15, 20.
  2. Find the mean absolute deviation (MAD) of the data 10, 13, 15, 18.
  1. Boss problem. Four plants grew 5, 12, 14 and 21 cm.

Exit ticket

Three questions to check you have got it.

  1. Find the mean absolute deviation (MAD) of the data 8, 13, 15, 20.
  2. Find the mean absolute deviation (MAD) of the data 10, 13, 15, 18.
  3. Find the mean absolute deviation (MAD) of the data 1, 8, 12, 19.

Summary card

Mean absolute deviation

Average distance from the mean.

Watch out: distances, not signed differences.

6. Outliers and boxplots

Warm-up

Three quick questions from earlier lessons.

Discover

Q1=20Q_1 = 20, Q3=30Q_3 = 30, so IQR =10= 10. Is a value of 48 unusually large?

  1. Yes, it is above 30+1.5×10=4530 + 1.5 \times 10 = 45
  2. No: only values above twice Q3Q_3, 60, are outliers

Key idea

A rule of thumb for outliers, and a picture of the five-number summary.

1.5 × IQR rule: a value is an outlier if it is below Q1−1.5 IQRQ_1 - 1.5\,\text{IQR} or above Q3+1.5 IQRQ_3 + 1.5\,\text{IQR}. A boxplot draws the box from Q1Q_1 to Q3Q_3, a line at the median, whiskers to the most extreme non-outliers, and outliers as separate points.

Worked example

Q1=14Q_1 = 14, Q3=26Q_3 = 26. The fences.

IQR =12= 12
26 − 14.
Fences 14−18=−414 - 18 = -4 and 26+18=4426 + 18 = 44
1.5 × 12 = 18.
Outliers: below −4-4 or above 4444
Any value beyond them.

Your turn, guided

Your turn: Q1=40Q_1 = 40, Q3=50Q_3 = 50. The lower fence.

2525
40 − 15.

Practice ★

  1. A data set has Q1=24Q_1 = 24 and Q3=32Q_3 = 32. Above which value is a data point an outlier by the 1.5×IQR1.5 \times \text{IQR} rule?
  2. A data set has Q1=36Q_1 = 36 and Q3=66Q_3 = 66. Above which value is a data point an outlier by the 1.5×IQR1.5 \times \text{IQR} rule?
  3. A data set has Q1=19Q_1 = 19 and Q3=57Q_3 = 57. Above which value is a data point an outlier by the 1.5×IQR1.5 \times \text{IQR} rule?

Watch out!

Practice ★★

  1. Q1=34Q_1 = 34 and Q3=44Q_3 = 44. Below which value is a data point an outlier?
  2. Q1=40Q_1 = 40 and Q3=48Q_3 = 48. Below which value is a data point an outlier?
  1. A boxplot of 81 values shows which summary?
    1. The five-number summary (min, Q1, median, Q3, max), with outliers plotted separately
    2. The mean and the standard deviation
    3. How many values fall in each interval

Exit ticket

Three questions to check you have got it.

  1. A data set has Q1=24Q_1 = 24 and Q3=32Q_3 = 32. Above which value is a data point an outlier by the 1.5×IQR1.5 \times \text{IQR} rule?
  2. A data set has Q1=36Q_1 = 36 and Q3=66Q_3 = 66. Above which value is a data point an outlier by the 1.5×IQR1.5 \times \text{IQR} rule?
  3. A data set has Q1=19Q_1 = 19 and Q3=57Q_3 = 57. Above which value is a data point an outlier by the 1.5×IQR1.5 \times \text{IQR} rule?

Summary card

Outliers and boxplots

  • Fences: Q1−1.5 IQRQ_1 - 1.5\,\text{IQR} and Q3+1.5 IQRQ_3 + 1.5\,\text{IQR}.
  • Boxplot: five-number summary plus outliers.

Watch out: 1.5 × IQR, not 1 × IQR.