Steady State
İST205 / Lecture 4
Lecture 4 · Week 4 · Lind, Marchal & Wathen ch. 4 · about 45 min

Displaying and Exploring Data

How to display and explore one variable with dot plots, stem-and-leaf displays, percentiles and box plots, how to measure skewness, and how to picture the relationship between two variables.

By the end you can
  • Construct and interpret dot plots and stem-and-leaf displays.
  • Locate quartiles, deciles and percentiles with the location formula.
  • Build and read box plots and flag outliers with the 1.5 times IQR rule.
  • Compute Pearson's coefficient of skewness and identify distribution shapes.
  • Read scatter diagrams and contingency tables that describe two variables.

Chapter 3 gave you the mean, median, variance and standard deviation. This chapter adds tools that describe where values sit (position), what the data look like when you draw them (shape), and how two variables move together. Everything here is still descriptive statistics: no probability, no inference.

Dot plots

A dot plot draws one dot for every observation above a horizontal number line. If two observations are equal (or too close to tell apart), the dots are piled on top of each other.

Because every dot is a real observation, you do not lose the identity of any value. That is the key difference from a histogram, where values are binned into classes and the individual observations disappear. Dot plots are best for small data sets and for comparing two or more groups on the same scale; histograms are better for large data sets.

Example. Tionesta Ford Lincoln and Sheffield Motors serviced cars on 24 working days each:

Software summary of the two samples:

StatisticTionestaSheffield
Mean31.2935.83
Median3236
Standard deviation4.114.96
Minimum2326
Maximum3944

Reading the plots: Sheffield services more cars on a typical day (its mean is 4.54 cars higher) and its data are more spread out (larger standard deviation). The Sheffield distribution has a low value of 26 that sits 4 cars below the next lowest day. Tionesta serviced exactly 32 cars on 4 different days. The values cluster around 32 for Tionesta and around 36 for Sheffield.

Chart · Tionesta vs Sheffieldsolid = mean · dashed = median
TionestaTionesta: 23 cars serviced per dayTionesta: 25 cars serviced per dayTionesta: 26 cars serviced per dayTionesta: 27 cars serviced per dayTionesta: 27 cars serviced per dayTionesta: 28 cars serviced per dayTionesta: 28 cars serviced per dayTionesta: 29 cars serviced per dayTionesta: 30 cars serviced per dayTionesta: 30 cars serviced per dayTionesta: 31 cars serviced per dayTionesta: 32 cars serviced per dayTionesta: 32 cars serviced per dayTionesta: 32 cars serviced per dayTionesta: 32 cars serviced per dayTionesta: 33 cars serviced per dayTionesta: 33 cars serviced per dayTionesta: 35 cars serviced per dayTionesta: 35 cars serviced per dayTionesta: 35 cars serviced per dayTionesta: 36 cars serviced per dayTionesta: 36 cars serviced per dayTionesta: 37 cars serviced per dayTionesta: 39 cars serviced per daySheffieldSheffield: 26 cars serviced per daySheffield: 30 cars serviced per daySheffield: 30 cars serviced per daySheffield: 31 cars serviced per daySheffield: 31 cars serviced per daySheffield: 31 cars serviced per daySheffield: 32 cars serviced per daySheffield: 33 cars serviced per daySheffield: 34 cars serviced per daySheffield: 34 cars serviced per daySheffield: 35 cars serviced per daySheffield: 36 cars serviced per daySheffield: 36 cars serviced per daySheffield: 36 cars serviced per daySheffield: 37 cars serviced per daySheffield: 37 cars serviced per daySheffield: 37 cars serviced per daySheffield: 38 cars serviced per daySheffield: 40 cars serviced per daySheffield: 42 cars serviced per daySheffield: 43 cars serviced per daySheffield: 43 cars serviced per daySheffield: 44 cars serviced per daySheffield: 44 cars serviced per day2530354045cars serviced per day
TionestaSheffield
Mean31.2935.83
Median32.0036.00
Range16.0018.00
St. dev. s4.114.96

Sheffield services more cars on a typical day (its dots sit further right) and its counts are more spread out. Look for the piles: Tionesta reached 32 cars on four days, and Sheffield has one unusually slow day at 26. Hover a dot to read it.

Check your understanding

Which statement about dot plots is correct?

Your turn

A dot plot of cars serviced at the Tionesta dealership on the first eight working days shows 23, 33, 27, 28, 39, 26, 30 and 32 vehicles. What is the median number of cars serviced per day for these eight days?

Stem-and-leaf displays

A stem-and-leaf display is another way to show a whole data set, but it keeps the actual digits. Split each value into a stem (the leading digit or digits) and a leaf (the trailing digit). Stems go down the left side, leaves line up to the right, and it is customary to sort the leaves from smallest to largest.

Compare this with a frequency distribution. A frequency distribution gives you class counts quickly, but it has two disadvantages: you lose the exact identity of each value, and you cannot see how values are spread inside a class. A stem-and-leaf display fixes both.

Example. Table 4-1 lists the number of people attending each of 45 performances at the Theater of the Republic:

96  93  88  117 127 95  113 96  108 94  148 156
139 142 94  107 125 155 155 103 112 127 117 120
112 135 132 111 125 104 106 139 134 119 97  89
118 136 125 143 120 103 113 124 138

The smallest attendance is 88, so stems start at 8; the largest is 156, so stems end at 15. After sorting the leaves:

Stem | Leaf
8    | 8 9
9    | 3 4 4 5 6 6 7
10   | 3 3 4 6 7 8
11   | 1 2 2 3 3 7 7 8 9
12   | 0 0 4 5 5 5 7 7
13   | 2 4 5 6 8 9 9
14   | 2 3 8
15   | 5 5 6

What you can read off it immediately: the minimum is 88 and the maximum is 156; only two performances drew fewer than 90 people; three drew 150 or more, and their exact values were 155, 155 and 156. Attendance concentrates between 100 and 130: for example, 120 people attended two performances, 124 attended one, and 125 attended three.

Interactive · Theater of the Republic advertising spotsn = 45
StemLeaf88 993 4 4 5 6 6 7103 3 4 6 7 8111 2 2 3 3 7 7 8 9120 0 4 5 5 5 7 7132 4 5 6 8 9 9142 3 8155 5 6same data as bars
Mean x̄
118.889
Median
118
Mode
125
Range
68
Sample variance s² (÷ n−1)
354.283
Sample st. dev. s
18.822
Population σ (÷ N)
18.612
Q1 · Q3
103.5 · 134.5
IQR
31
Pearson skewness
0.142

Each row is a stem; each digit after the bar is one observation. Turn the page sideways and it is a histogram, but every value is still readable.

Check your understanding

A stem-and-leaf display contains the row 12∣0 4 912 \mid 0\ 4\ 9. Assuming whole-number values, which observations does this row contain?

Your turn

A survey asked eight subscribers how many phone calls they made last week: 30, 42, 52, 38, 34, 46, 41, 18. Build the stem-and-leaf display and report the median number of calls.

Measures of position: quartiles, deciles and percentiles

The standard deviation measures spread; measures of position locate a value inside the ordered data. Quartiles divide the ordered data into 4 equal parts, deciles into 10, and percentiles into 100.

Location of a percentileFormula 4-1Formula sheet →
LP=(n+1)P100L_P = (n + 1)\frac{P}{100}
LPL_P
location (position number) of the Pth percentile in the ordered array
nn
number of observations
PP
the percentile wanted (25 for Q_1, 50 for the median, 75 for Q_3, 20 for the 2nd decile)

Use it when you need to find the position of a quartile, decile or percentile in data sorted from smallest to largest.

Steps for using it:

  1. Sort the data from smallest to largest.
  2. Compute LP=(n+1)P100L_P = (n + 1)\dfrac{P}{100}.
  3. If LPL_P is a whole number, the percentile is the value at that position.
  4. If LPL_P is not whole (say 5.25), go to the position below and move that fraction of the way to the next value.
Worked example · Worked example: quartiles of broker commissions0/5

Morgan Stanley's Oakland office: commissions earned last month by a sample of 15 brokers, in dollars: 2038, 1758, 1721, 1637, 2097, 2047, 2205, 1787, 2287, 1940, 2311, 2054, 2406, 1471, 1460. Find the median, the first quartile and the third quartile.

When the location is not a whole number. Suppose n=20n = 20 and you want Q1Q_1: L25=(20+1)25100=5.25L_{25} = (20 + 1)\dfrac{25}{100} = 5.25. Go to the 5th value and move 0.25 of the distance to the 6th value. A quartile, like the median, need not be one of the actual data values.

For a concrete case, take the six values 91, 75, 61, 101, 43, 104. Ordered: 43, 61, 75, 91, 101, 104. Then L25=(6+1)25100=1.75L_{25} = (6 + 1)\dfrac{25}{100} = 1.75. The first quartile is 0.75 of the way from the 1st value (43) to the 2nd (61): distance 61−43=1861 - 43 = 18, so Q1=43+0.75(18)=43+13.5=56.5Q_1 = 43 + 0.75(18) = 43 + 13.5 = 56.5.

The same interpolation works for any percentile. To find the 23rd percentile of 80 observations, L23=(80+1)23100=18.63L_{23} = (80 + 1)\dfrac{23}{100} = 18.63: take the 18th value, add 0.63 times the gap between the 18th and 19th values.

Interactive · Morgan Stanley commissions ($)n = 15
146011471216373172141758517876194072038820479205410209711220512228713231114240615L = 4 → P25 = 1721position in sorted data
Mean x̄
1947.933
Median
2038
Mode
none
Range
946
Sample variance s² (÷ n−1)
89274.924
Sample st. dev. s
298.789
Population σ (÷ N)
288.658
Q1 · Q3
1721 · 2205
IQR
484
Pearson skewness
-0.904

Location formula: L = (n + 1)P/100 = (15 + 1) × 25/100 = 4. A whole number: read that position directly.

Interactive · Six values: quartiles by interpolationn = 6
43161275391410151046L = 1.75 → P25 = 56.5position in sorted data43 + 0.75 × (61 − 43) = 56.5
Mean x̄
79.167
Median
83
Mode
none
Range
61
Sample variance s² (÷ n−1)
577.767
Sample st. dev. s
24.037
Population σ (÷ N)
21.942
Q1 · Q3
56.5 · 101.75
IQR
45.25
Pearson skewness
-0.478

Location formula: L = (n + 1)P/100 = (6 + 1) × 25/100 = 1.75. Not a whole number: go that fraction of the way between the two neighbouring values.

Check your understanding

The median of a sample is the same as which percentile?

Your turn

Eight recent orders were 12, 15, 18, 20, 24, 28, 33 and 40 units. Find the first quartile Q1Q_1 using the location formula.

Box plots and outliers

A box plot (box-and-whisker plot) pictures five statistics of a data set at once. Draw a box from Q1Q_1 to Q3Q_3, put a line inside it at the median, and extend whiskers from the box out to the smallest and largest values (or to the smallest and largest values that are not outliers).

Interquartile rangeFormula sheet →
IQR=Q3−Q1IQR = Q_3 - Q_1
IQRIQR
interquartile range
Q1Q_1
first quartile
Q3Q_3
third quartile

Use it when you want the spread of the middle 50% of the data, the width of the box.

Outlier limitsFormula sheet →
L=Q1−1.5 IQR,U=Q3+1.5 IQRL = Q_1 - 1.5\,IQR, \qquad U = Q_3 + 1.5\,IQR
LL
lower limit below which a value is an outlier
UU
upper limit above which a value is an outlier
IQRIQR
interquartile range

Use it when you must decide whether a value is an outlier: any observation outside these limits is flagged (an asterisk in a box plot).

Example (Alexander’s Pizza). For 20 deliveries:

StatisticValue
Minimum13 min
Q1Q_115 min
Median18 min
Q3Q_322 min
Maximum30 min

The box runs from 15 to 22, so the IQR is 22−15=722 - 15 = 7 minutes: half of all deliveries fall between 15 and 22 minutes. The distribution is positively skewed, and there are two clues. First, the right whisker (22 to 30, a span of 8 minutes) is much longer than the left whisker (13 to 15, only 2 minutes): the top 25% of the data is more spread out than the bottom 25%. Second, the median is not centred in the box: it is 3 minutes from Q1Q_1 but 4 minutes from Q3Q_3.

Chart · box plot of Alexander's Pizza delivery timesIQR = 7.00
min 13Q1 15median 18Q3 22max 301015202530minutes

The box runs from Q1 = 15.00 to Q3 = 22.00: the middle 50% of the data. Its length is the interquartile range, IQR = 22.00 − 15.00 = 7.00 minutes.

Example (Applewood buyer ages). Summary values: Q1=40Q_1 = 40 years, median = 46 years, Q3=52.75Q_3 = 52.75 years. Then IQR=52.75−40=12.75IQR = 52.75 - 40 = 12.75 years, and the outlier limits are:

Three purchasers were 72 years or older (in fact 72, 72 and 73), so they appear as asterisks: the plot flags them as outliers. No one was younger than 21, so there is no low outlier. Apart from those high outliers the distribution is fairly symmetric: the two whiskers are about the same length, and the median sits close to the middle of the box (40 to 46 is 6 years, 46 to 52.75 is 6.75 years).

Chart · box plot of Applewood buyer agesIQR = 12.75
lower fence 20.875upper fence 71.875***min 21Q1 40median 46Q3 52.75max* 7020304050607080years

The box runs from Q1 = 40.00 to Q3 = 52.75: the middle 50% of the data. Its length is the interquartile range, IQR = 52.75 − 40.00 = 12.75 years.

* largest value inside the upper fence; the asterisks are the outliers.

Check your understanding

A box plot shows a long right whisker, and the median line sits closer to Q1Q_1 than to Q3Q_3. How should you describe the distribution?

Your turn

Alexander's Pizza delivery times: minimum 13, Q1=15Q_1 = 15, median 18, Q3=22Q_3 = 22, maximum 30 minutes. Using the 1.5 times IQR rule, what is the upper limit above which a delivery time would be an outlier?

Skewness

The shape of a distribution is described by one of four patterns:

ShapeWhat it looks likeMean versus medianTypical example
SymmetricLeft half mirrors the right halfMean equals medianAges of buyers
Positively skewedSingle peak, long tail to the rightMean greater than medianSalaries, incomes
Negatively skewedSingle peak, long tail to the leftMean less than medianTest scores when most students score high
BimodalTwo (or more) peaksPeaks suggest two populationsOutside diameters made by two machines

Positively skewed data are the most common in business. Think of salaries in a company of about 100 people: the president and a few executives earn far more than everyone else, so the right tail is long and the mean is dragged above the median.

Pearson’s coefficient of skewness uses exactly this mean-versus-median gap.

Pearson's coefficient of skewnessFormula 4-2Formula sheet →
sk=3(xˉ−Median)ssk = \frac{3(\bar{x} - \text{Median})}{s}
sksk
coefficient of skewness
xˉ\bar{x}
sample mean
MedianMedian
sample median
ss
sample standard deviation

Use it when you want a quick numerical measure of the direction and degree of skewness from the mean, median and standard deviation.

Interpretation: sksk runs from −3-3 to 33. A value near 00 (mean equals median) means symmetry; a value near −3-3 (such as −2.57-2.57) means considerable negative skew; a value such as 1.631.63 means moderate positive skew.

Statistical software (Minitab, Excel) instead computes skewness from cubed standardised deviations:

Software coefficient of skewnessFormula 4-3Formula sheet →
sk=n(n−1)(n−2)∑(x−xˉs)3sk = \frac{n}{(n - 1)(n - 2)} \sum \left( \frac{x - \bar{x}}{s} \right)^3
sksk
coefficient of skewness
nn
number of observations
xx
each observation
xˉ\bar{x}
sample mean
ss
sample standard deviation

Use it when you are reading software output or asked for the software method; it is built from the cubed deviations of each value from the mean in standard-deviation units.

Why it works: each term (x−xˉ)/s(x - \bar{x})/s standardises a value (how many standard deviations from the mean). Cubing keeps the direction (values above the mean stay positive). If the data are symmetric the positive and negative cubes cancel to about zero; a few very large values push the sum strongly positive; a few very small values push it negative.

For the two building blocks, recall from Chapter 3:

Sample meanFormula sheet →
xˉ=∑xn\bar{x} = \frac{\sum x}{n}
xˉ\bar{x}
sample mean
∑x\sum x
sum of all observations
nn
number of observations

Use it when you need the arithmetic average of a sample.

Sample standard deviationFormula sheet →
s=∑(x−xˉ)2n−1s = \sqrt{\frac{\sum (x - \bar{x})^2}{n - 1}}
ss
sample standard deviation
xx
each observation
xˉ\bar{x}
sample mean
nn
number of observations

Use it when you need the typical distance of observations from the sample mean.

Worked example · Worked example: skewness of earnings per share0/6

Earnings per share (dollars) for a sample of 15 software companies in 2016, ordered from smallest to largest: 0.09, 0.13, 0.41, 0.51, 1.12, 1.20, 1.49, 3.18, 3.50, 6.36, 7.83, 8.92, 10.13, 12.99, 16.40. Compute the mean, median and standard deviation, then the coefficient of skewness with both methods.

Your turn

Five data entry clerks revised 73, 98, 60, 92 and 84 tax records last hour. Compute Pearson's coefficient of skewness.

Check your understanding

A data set of annual incomes has mean 52,000 dollars and median 46,000 dollars. What is the shape of the distribution?

Interactive · shape, mean, median and moderight tail
meanmedianmodevalue →
Mean − median
0.17
Pearson sk = 3(x̄ − median)/s
0.52

Positively (right) skewed: the long right tail drags the mean to the right. The median moves less, the mode stays at the peak. Order: mode < median < mean.

Describing the relationship between two variables

Up to now every display described a single variable (univariate data). Bivariate data record two variables for each observation: hours studied and exam score; advertising spending and monthly billings; a father’s height and his son’s height; the odometer reading of a used car and its auction price.

A scatter diagram plots one variable on the horizontal (X) axis and the other on the vertical (Y) axis, one point per observation. Put the variable that you think depends on the other on the Y axis: if height of the father is thought to influence the height of the son, put father’s height on X and son’s height on Y.

How to read the pattern:

Interactive · what does each scatter diagram show?
age (years) →cost ($) →
Age of buses vs maintenance cost
miles (000) →price ($000) →
Odometer vs auction price
height (in) →salary ($000) →
Height vs salary

Classify each panel. Illustrative data shaped like Chart 4-2. A scatter diagram needs two quantitative variables measured on the same units (here: buses, cars, people).

Check your understanding

In a scatter diagram the points run from the upper left corner to the lower right corner. What kind of relationship does this show?

Contingency tables

A scatter diagram needs both variables to be at least interval scale. When one or both variables are nominal or ordinal, we cross-tabulate the counts instead.

Examples of suitable pairs: gender and class year of students; acceptable or unacceptable product and the production shift; party affiliation and whether the voter has children in the district.

Example (Applewood profit and dealership). Profit is a ratio variable, so it is first converted into an ordinal variable by splitting sales at the median profit of 1,882.50 dollars: above the median versus below it. The four dealerships form the other variable:

Above or below median profitKaneOleanSheffieldTionestaTotal
Above median2520192690
Below median2720261790
Total52404543180

What the table says: as expected from the definition of the median, exactly 90 of the 180 sales lie on each side. Comparing dealerships with column percentages (each part divided by its column total):

Tionesta stands out: 60% of its sales beat the median profit, well above Sheffield’s 42%. A second example: of 100 male customers, 32 ordered dessert (32%); of 100 female customers, only 15 did (15%). Men in that sample were about twice as likely to order dessert.

Chart · Applewood profit vs dealershipn = 180
Above median profitBelow median profitKane48%52%Olean50%50%Sheffield42%58%Tionesta60%40%50%
Cell
Kane, above median profit
Count
25
% of Kane (52)
48.1%
% of all 180
13.9%

100% bars put groups of different size on the same footing. Tionesta has the largest share above median profit (60%), Sheffield the smallest (42%). Click a segment.

Your turn

Using the Applewood table, what percentage of the cars sold by the Kane dealership were sold above the median profit? Give your answer in percent.

Exam practice

Exam question 1

The Theater of the Republic stem-and-leaf display (45 performances) has stems 8 to 15. How many performances had an attendance of at least 140 people?

Exam question 2

The amounts refinanced for 20 loans, in thousands of dollars, are ordered from smallest to largest: 59.2, 59.5, 61.6, 65.5, 66.6, 72.9, 74.8, 77.3, 79.2, 83.7, 85.6, 85.8, 86.6, 87.0, 87.1, 90.2, 93.3, 98.6, 100.2, 100.7. Find the 83rd percentile.

Exam question 3

For Applewood buyer ages, the five-number summary is: minimum 21, Q1=40Q_1 = 40, median 46, Q3=52.75Q_3 = 52.75, maximum 73 years. Which statement is correct?

Exam question 4

Five accounting graduates accepted starting salaries of 36.0, 26.0, 33.0, 28.0 and 31.0 thousand dollars. Compute the coefficient of skewness using Pearson's method.

Exam question 5

Of 200 recent customers at Devine Dining, 32 of 100 men and 15 of 100 women ordered dessert. Which conclusion does the table support?

Summary and review

Review deck · 18 cards0/18 mastered