Where a value sits inside its data set. Quartiles cut the ordered data into four parts, with the first quartile the median of the lower half and the third the median of the upper half; the interquartile range measures the spread of the middle fifty percent and supplies the 1.5 IQR rule that turns a visual judgement about outliers into arithmetic anyone can repeat; percentiles cut the data into hundredths and are what a score in the ninetieth percentile actually means; and two formulas run in opposite directions, one taking a percentile and returning a value by the index rule, the other taking a value and returning its percentile by counting what lies below it.
Subject: Statistics · 74 slides · symbolic lesson
Open the interactive version of this deck
Title
Statistics · Section 2.3
Quartiles, the interquartile range, outliers and percentiles: where a value stands among the others
Objectives
Section 2.2 drew the whole shape of a data set. This section asks a sharper question about a single value: where does it stand among the others? Is a house price ordinary or extreme, is a test score near the top or the middle, is a sleep time typical?
Every answer in this lesson starts with the same move, putting the data in order, and then counts places along that ordered list. The arithmetic is gentle; the marks are lost in deciding which places to count.
Keep one sentence in mind throughout: a measure of location is always a value of the variable, in the units of the data, with a known share of the data on each side of it. If you can say all three parts, you understand the number.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 86 — the section opening
Warm-up
Start from the histogram you built last section. Of the 100 soccer players, 5 were in the first class, 3 in the second, 15 in the third and 40 in the fourth, which ran from 65.95 to 67.95 inches.
| class (inches) | 59.95–61.95 | 61.95–63.95 | 63.95–65.95 | 65.95–67.95 | 67.95–75.95 |
|---|---|---|---|---|---|
| players | 5 | 3 | 15 | 40 | 37 |
Discussion prompt
A player is 66 inches tall. Without computing a mean, describe where he stands in this squad: roughly what share of the players are shorter than him, and what share taller? What would you need to know to say exactly?
There is a second lesson in this warmup. A histogram groups values into classes, so it can only say a player is somewhere inside a class. To place one value exactly you have to return to the individual values, sorted, which is why every method in this section begins with the ordered list rather than with a table of classes.
Notice the shape of the answer: a value, 66 inches, and the share of the squad below and above it. Quartiles and percentiles are nothing more than that kind of statement made precise, and the last part of this lesson insists that every interpretation says both shares.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.2, pp. 76-77 — Example 2.7
Section
Part 1
Concept
The book names two common measures of location. Quartiles divide an ordered data set into four equal parts, and percentiles divide it into a hundred. Both are cuts along the ordered list, not averages.
\[ Q_1 \le Q_2 = \text{median} \le Q_3 \]
Notice the word about. With fourteen values you cannot put exactly a quarter, 3.5 values, below a cut, so the quartiles split the data as evenly as whole values allow. The book's phrase is four equal parts, and it means as equal as the count permits.
Notice also the words on or below. A cut can land exactly on a data value, and when it does, that value is counted with the lower group. You will see the same convention in the definition of a percentile.
And everything starts from order. To calculate quartiles and percentiles, the book says, the data must be ordered from smallest to largest, because a quartile is defined by places in the list, and places only mean something once the list is sorted.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 86 — quartiles and percentiles
Worked example
The book's first data set has fourteen values, given in the order they were collected. The median is the number that separates the ordered data into halves, so the first move is to sort.
\[ 1;\ 11.5;\ 6;\ 7.2;\ 4;\ 8;\ 9;\ 10;\ 6.8;\ 8.3;\ 2;\ 2;\ 10;\ 1 \]
Order from smallest to largest
Why: every later step counts places, so the places have to mean something.
\[ 1,\ 1,\ 2,\ 2,\ 4,\ 6,\ 6.8,\ 7.2,\ 8,\ 8.3,\ 9,\ 10,\ 10,\ 11.5 \]
Find the middle place
Why: with n values the middle is at place one half of n plus 1; an even count gives a half-place.
\[ \dfrac{n + 1}{2} = \dfrac{14 + 1}{2} = 7.5 \]
Read the two neighbouring places
Why: place 7.5 sits between the seventh and eighth values.
\[ x_{(7)} = 6.8, \qquad x_{(8)} = 7.2 \]
Average them
Why: add the two values and divide by two, as the book does.
\[ \text{median} = \dfrac{6.8 + 7.2}{2} = \dfrac{14}{2} = 7 \]
Seven is not one of the fourteen values, and that is fine. The book is explicit that the median does not actually have to be one of the observed values; it is a number that separates the ordered data into halves.
Check that seven splits the data in half
Why: count the values on each side of 7 in the ordered list.
\[ \underbrace{1, 1, 2, 2, 4, 6, 6.8}_{7 \text{ values}} \; 7 \; \underbrace{7.2, 8, 8.3, 9, 10, 10, 11.5}_{7 \text{ values}} \]
Seven values below and seven above, so 7 is the median. Had you skipped the sorting and taken the seventh and eighth values of the original list, 9 and 10, you would have reported 9.5, a number with ten values below it.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 86-87 — the median of fourteen values
Worked example
With the median found, the book's recipe for the other two quartiles is short: Q1 is the middle value of the lower half of the data, and Q3 is the middle value, or median, of the upper half.
Write down the lower half
Why: the seven values below the median of 7.
\[ 1,\ 1,\ 2,\ 2,\ 4,\ 6,\ 6.8 \]
Take its median
Why: seven values, so the middle is place 4 of the half.
\[ \dfrac{7 + 1}{2} = 4 \;\Rightarrow\; Q_1 = 2 \]
Write down the upper half
Why: the seven values above the median.
\[ 7.2,\ 8,\ 8.3,\ 9,\ 10,\ 10,\ 11.5 \]
Take its median
Why: again place 4 of seven.
\[ Q_3 = 9 \]
Figure (svg): A dot plot of the fourteen values 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10 and 11.5 on a number line from 0 to 12, with repeated values stacked. Three vertical lines mark Q1 at 2, the median at 7 and Q3 at 9. The words lower half: 7 values sit to the left of the median line and upper half: 7 values to the right.
Read the result as the book does. One-fourth of the values are the same as or less than 2, and three-fourths are more than 2. Three-fourths, 75 percent, of the ordered data are less than 9, and one-fourth are greater than 9. Both quartiles here happen to be values in the data set.
Check the four groups
Why: count the values at or below each cut and compare with a quarter, a half and three-quarters of 14.
\[ \#(\le 2) = 4, \quad \#(\le 7) = 7, \quad \#(\le 9) = 11 \]
A quarter of 14 is 3.5, a half is 7 and three-quarters is 10.5. The counts 4, 7 and 11 are the nearest whole numbers the data allow, because both 2s sit on the Q1 cut and the 9 sits on the Q3 cut.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — the quartiles of the fourteen values
Concept
The fourteen values split cleanly because fourteen is even: the median fell in a gap, and all fourteen values joined one half or the other. With an odd count the median lands on an actual value, and you have to decide which half it belongs to.
Figure (svg): Two rows of numbered boxes. Top row, fourteen places: places 1 to 7 in blue, 8 to 14 in orange, a yellow cut between 7 and 8 marking the median, and green rings around place 4 (Q1) and place 11 (Q3). Bottom row, thirteen places: place 7 in yellow is the median and belongs to neither half; places 1 to 6 are the lower half with Q1 cut between places 3 and 4, and places 8 to 13 the upper half with Q3 cut between places 10 and 11.
The book's convention, used in every one of its examples, is that the median belongs to neither half. With thirteen values the median is the seventh, and the halves are places 1 to 6 and places 8 to 13, six values each.
\[ n = 13: \quad \text{median} = x_{(7)}, \quad Q_1 = \dfrac{x_{(3)} + x_{(4)}}{2}, \quad Q_3 = \dfrac{x_{(10)} + x_{(11)}}{2} \]
Look at the green cuts in each row. With fourteen values, each half has seven places, an odd number, so Q1 and Q3 are single places, 4 and 11. With thirteen, each half has six, an even number, so Q1 and Q3 are averages of two places.
Other textbooks and some software include the median in both halves, or interpolate, and can print a slightly different Q1. This deck follows the book throughout, and the Part 4 counterexample shows a case where two reasonable methods disagree.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 86-87 — the median and the quartiles
Prediction
Example 2.13, coming in Part 2, lists thirteen real estate prices. Before you see them in full, decide what the lower half will be once they are ordered.
Predict first
Thirteen prices are put in order and the median is the seventh. Which values make up the lower half used to find Q1?
Correct: the six prices below the median
Why: With an odd count the median is a value of its own, and the book leaves it out of both halves. The lower half is places 1 to 6, the upper half is places 8 to 13, and each quartile is the median of six values, the average of the third and fourth.
\[ \underbrace{x_{(1)}, \dots, x_{(6)}}_{\text{lower half}} \quad x_{(7)} \quad \underbrace{x_{(8)}, \dots, x_{(13)}}_{\text{upper half}} \]
The tempting choice is to keep the median in the lower half, because it is on or below itself. The next slide shows what that does to the answer: it is not a disaster, but it is a different number from the one the book prints.
Why does the book leave the median out? With an odd count the median is the one value exactly in the middle, so it belongs to the lower and the upper half equally. Giving it to one side would tilt the split; giving it to neither leaves two halves of the same size.
The meta-skill is this: when a rule depends on a convention, say the convention out loud before calculating. Most disagreements between two students' quartiles come from this one choice.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — Example 2.13
Trap
For the thirteen ordered prices, a student puts the median into the lower half:
\[ 114{,}950, \dots, 479{,}000, 488{,}800 \]
That half has seven values, so its middle is the fourth:
\[ Q_1 = 387{,}000 \]
Now only six prices sit below the median in one half and seven in the other.
Leave the median out; each half has six values.
\[ 114{,}950, \dots, 479{,}000 \]
\[ Q_1 = \dfrac{230{,}500 + 387{,}000}{2} \]
\[ = 308{,}750 \]
Three prices lie below 308,750, the nearest whole count to a quarter of 13, which is 3.25.
Worked example
Try It 2.13 gives eleven salaries in dollars and asks for the IQR and any outliers. The quartiles come first. Eleven is odd, so expect the median to be one of the salaries and to sit in neither half.
\[ 33{,}000;\ 64{,}500;\ 28{,}000;\ 54{,}000;\ 72{,}000;\ 68{,}500 \]
\[ 69{,}000;\ 42{,}000;\ 54{,}000;\ 120{,}000;\ 40{,}500 \]
Order the salaries
Why: smallest to largest; the two 54,000s stay as two separate places.
\[ 28{,}000,\ 33{,}000,\ 40{,}500,\ 42{,}000,\ 54{,}000,\ 54{,}000, \]
\[ 64{,}500,\ 68{,}500,\ 69{,}000,\ 72{,}000,\ 120{,}000 \]
Find the median
Why: eleven values, so the middle is place 6.
\[ \dfrac{11 + 1}{2} = 6 \;\Rightarrow\; \text{median} = 54{,}000 \]
Find Q1 from the lower half
Why: places 1 to 5; its middle is place 3 of the half.
\[ 28{,}000,\ 33{,}000,\ \boxed{40{,}500},\ 42{,}000,\ 54{,}000 \;\Rightarrow\; Q_1 = 40{,}500 \]
Find Q3 from the upper half
Why: places 7 to 11; again the third of five.
\[ 64{,}500,\ 68{,}500,\ \boxed{69{,}000},\ 72{,}000,\ 120{,}000 \;\Rightarrow\; Q_3 = 69{,}000 \]
Something worth noticing: one 54,000 sits in the lower half and the other is the median. The halves are built from places, not from values, so two equal salaries can land on different sides of the cut.
Check the split
Why: five salaries below the median and five above, with the median itself the sixth.
\[ 5 + 1 + 5 = 11 \]
Every salary is accounted for once. Because each half has five values, an odd number, both quartiles are salaries somebody actually earns, and you will use them on the outlier slide in Part 2.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Try It 2.13
Sorting
Sometimes Q1 is a value in the data, and sometimes it falls between two values. The count n decides which, once you know how the halves are formed. Work out the size of the lower half for each data set before sorting.
Sort into buckets
Sort each data set by whether its Q1, found the book's way, is always a single data value or may fall between two values.
\[ \text{lower half size} = \left\lfloor \dfrac{n}{2} \right\rfloor: \quad 14 \to 7, \quad 13 \to 6, \quad 20 \to 10, \quad 22 \to 11 \]
The day class shows that averaging two values can still give a data value: its lower half's middle pair is 56 and 56, so Q1 is 56. Averaging two values means Q1 may fall between values, not that it must.
A quick way to do this in your head: halve n, dropping any half value left over, and ask whether the result is odd. An odd half has a middle value; an even half has a middle pair. The same test settles Q3, because the two halves are always the same size.
So the size of the half, not the size of the whole set, decides it. Fourteen and fifteen both give halves of seven, and so both give a Q1 that is a single value.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 87-94 — the section's data sets
Section
Part 2
Concept
Once you have Q1 and Q3, one subtraction gives a measure of spread. The book defines the interquartile range as a number that indicates the spread of the middle half, the middle 50 percent, of the data.
interquartile range (IQR) — The difference between the third quartile and the first quartile; the width of the stretch that holds the middle half of the ordered data.
\[ \text{IQR} = Q_3 - Q_1 \]
For the fourteen values, Q3 is 9 and Q1 is 2, so the middle half of the data is spread over 7 units.
\[ \text{IQR} = 9 - 2 = 7 \]
Why does Q3 minus Q1 hold the middle half? Below Q1 sits about a quarter of the data and above Q3 another quarter. What is left between them is the half in the middle, and its width is the IQR.
\[ \tfrac{1}{4} + \tfrac{1}{2} + \tfrac{1}{4} = 1 \]
Notice that the IQR is a distance, not a location. It says how wide the middle half is, but not where it sits: two data sets could both have an IQR of 7, one running from 2 to 9 and the other from 102 to 109.
The IQR is in the units of the data: dollars for prices, points for test scores, minutes for exercise. A bigger IQR means the typical values are more spread out; a smaller one means they are bunched together.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — the interquartile range
Concept
You already know one measure of spread: the range, the largest value minus the smallest. It is quick, but it reads only two values, the two most extreme, and that makes it fragile.
\[ \text{range} = 5{,}500{,}000 - 114{,}950 = 5{,}385{,}050 \]
That is the range of the thirteen house prices in Example 2.13. Now take away the one sale of 5.5 million dollars and recompute both measures for the twelve prices that remain.
\[ \text{range}_{12} = 1{,}095{,}000 - 114{,}950 = 980{,}050 \]
\[ \text{IQR}_{13} = 340{,}250, \qquad \text{IQR}_{12} = 607{,}000 - 308{,}750 = 298{,}250 \]
Figure (svg): Four horizontal bars on a scale from 0 to 5,500 thousand dollars. The range of all thirteen house prices is a long red bar of 5,385.05 thousand; the range without the 5.5 million dollar house is an orange bar of 980.05 thousand. The IQR of all thirteen is a short blue bar of 340.25 thousand, and the IQR without that house is a similar blue bar of 298.25 thousand.
One house cut the range by more than four-fifths. The IQR moved by about 12 percent, because Q1 did not change at all and Q3 only shifted from one middle pair to the next.
This is the reason the outlier rule is built on the IQR. A ruler that is itself stretched by the extreme values cannot be used to judge whether those values are extreme. The middle half is a ruler the extremes cannot bend.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — Example 2.13
Notation
The book's rule for a potential outlier is one sentence: a value is suspected to be a potential outlier if it is less than 1.5 times the IQR below the first quartile, or more than 1.5 times the IQR above the third quartile. Written as two fences, it reads like this.
Annotate
On: \( Q_1 - 1.5(\text{IQR}) \qquad Q_3 + 1.5(\text{IQR}) \)
Notice that nothing in the rule mentions the mean or the most extreme values. It is built entirely from the two quartiles, and that is deliberate: the quartiles are the numbers an extreme value has the least power to move.
Read the inequalities carefully: less than the lower fence, more than the upper fence. A value sitting exactly on a fence is not flagged. Example 2.22 has a value that lands exactly on its upper fence, so this detail will matter.
\[ x < Q_1 - 1.5(\text{IQR}) \quad \text{or} \quad x > Q_3 + 1.5(\text{IQR}) \]
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — the 1.5 IQR rule
Picture it
The rule is easiest to remember as a picture. Draw the middle half as a box from Q1 to Q3. Its width is the IQR. Then walk outwards from each end of the box for one and a half box widths, and put up a fence.
Figure (svg): A number line with a blue box from Q1 to Q3, labelled IQR. Orange arrows run from each end of the box outwards for one and a half box widths, to dashed red lines labelled lower fence and upper fence. Beyond each fence the line is shaded red and labelled potential outliers; between the fences it is labelled not flagged.
Everything between the two fences is ordinary for this data set. Anything beyond them gets the label potential outlier, and the book is firm about what that label means: potential outliers always require further investigation.
Notice that the distance from the median to a fence is not fixed either. If the data are lopsided, with Q3 much further from the median than Q1, the upper fence stands further out than the lower one. The fences follow the box.
\[ \text{upper fence} - \text{lower fence} = \text{IQR} + 2(1.5)(\text{IQR}) = 4(\text{IQR}) \]
So the two fences are always four box widths apart. A narrow box means close fences and many flags; a wide box means distant fences and few. You will see both on the two statistics classes of Example 2.14.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — potential outliers
Worked example
Example 2.13 gives thirteen real estate prices in dollars and asks for the IQR and any potential outliers. Thirteen is odd, so the median will be a price and will sit in neither half.
\[ 389{,}950;\ 230{,}500;\ 158{,}000;\ 479{,}000;\ 639{,}000;\ 114{,}950;\ 5{,}500{,}000;\ \dots \]
Order the prices
Why: smallest to largest; places 1 to 13.
\[ 114{,}950,\ 158{,}000,\ 230{,}500,\ 387{,}000,\ 389{,}950,\ 479{,}000 \]
Continue the ordered list
Why: the median and the upper half.
\[ 488{,}800,\ 529{,}000,\ 575{,}000,\ 639{,}000,\ 659{,}000,\ 1{,}095{,}000,\ 5{,}500{,}000 \]
Find the median
Why: thirteen values, so place 7.
\[ \dfrac{13 + 1}{2} = 7 \;\Rightarrow\; M = 488{,}800 \]
Find Q1
Why: the lower half is places 1 to 6, and its middle pair is places 3 and 4.
\[ Q_1 = \dfrac{230{,}500 + 387{,}000}{2} = \dfrac{617{,}500}{2} = 308{,}750 \]
Find Q3
Why: the upper half is places 8 to 13, and its middle pair is places 10 and 11.
\[ Q_3 = \dfrac{639{,}000 + 659{,}000}{2} = \dfrac{1{,}298{,}000}{2} = 649{,}000 \]
Neither quartile is a price anyone paid. They are cuts between sales, which is all a quartile needs to be: three sales lie below 308,750 and three above 649,000.
Check against the book
Why: the book prints M, Q1 and Q3 as 488,800, 308,750 and 649,000.
\[ M = 488{,}800, \quad Q_1 = 308{,}750, \quad Q_3 = 649{,}000 \;\checkmark \]
All three agree. In context: the middle half of these homes sold for between about 309 thousand and 649 thousand dollars, and the typical home for about 489 thousand.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — Example 2.13
Estimation
Two prices stand out at the top of Example 2.13: 1,095,000 and 5,500,000. Estimate before you calculate. Round the quartiles to 300 thousand and 650 thousand dollars.
Predict first
Using rounded quartiles of about 300 thousand and 650 thousand dollars, which of the two most expensive houses does the 1.5 IQR rule flag as a potential outlier?
Correct: only the 5,500,000 house
Why: The IQR is about 350 thousand, and one and a half of it is about 525 thousand. Added to Q3 of about 650 thousand, that puts the upper fence near 1.175 million. The 1,095,000 house is just inside; the 5,500,000 house is far outside.
\[ 650 + 1.5(650 - 300) = 650 + 525 = 1175 \text{ thousand} \]
The estimate is close enough to decide the question, because 5.5 million is nowhere near the fence. The 1,095,000 house is the delicate one: it is less than 100 thousand dollars inside, so the exact calculation is needed before you say anything about it.
Notice which numbers the estimate needed: only the two quartiles and the multiplier. You did not need the mean price or the distance from 5,500,000 to the median. Once the fences are placed, every value is judged by a single comparison with them.
Estimating first is a habit worth keeping. If your exact upper fence comes out at 11 million, or at 300 thousand, the estimate tells you at once that a step has gone wrong.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — Example 2.13
Worked example
With Q1 = 308,750 and Q3 = 649,000, the rest of Example 2.13 is four lines of arithmetic, then a comparison.
Compute the IQR
Why: the width of the middle half.
\[ \text{IQR} = 649{,}000 - 308{,}750 = 340{,}250 \]
Multiply by 1.5
Why: the distance each fence stands from its quartile.
\[ 1.5(340{,}250) = 510{,}375 \]
Place the lower fence
Why: walk down from Q1.
\[ Q_1 - 510{,}375 = 308{,}750 - 510{,}375 = -201{,}625 \]
Place the upper fence
Why: walk up from Q3.
\[ Q_3 + 510{,}375 = 649{,}000 + 510{,}375 = 1{,}159{,}375 \]
Figure (svg): Two dot plots of the thirteen house prices in thousands of dollars. Top, the full scale from 0 to 5,800: twelve dots crowd together at the left below 1,100, and one red dot sits alone at 5,500. A dashed red line marks the upper fence at 1,159.375. Bottom, zoomed to 0 to 1,300: the twelve dots are spread out, a blue band covers Q1 = 308.75 to Q3 = 649, and the fence line sits just to the right of the dot at 1,095.
The lower fence is a negative price, so no house can be below it: on the cheap side the rule cannot flag anything. On the expensive side, 1,095,000 is below 1,159,375 and is not flagged, while 5,500,000 is far above it.
Check each extreme against its fence
Why: compare the cheapest and the two dearest prices with the fences.
\[ 114{,}950 > -201{,}625, \quad 1{,}095{,}000 < 1{,}159{,}375, \quad 5{,}500{,}000 > 1{,}159{,}375 \]
Only the last comparison crosses a fence, so 5,500,000 is the one potential outlier, as the book concludes. It is a sale to investigate: a mansion, a commercial property or a typing error would each be handled differently.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — Example 2.13
Worked example
Return to the eleven salaries. You found Q1 = 40,500 and Q3 = 69,000. Now finish the Try It: the IQR and any outliers.
Compute the IQR
Why: Q3 minus Q1.
\[ \text{IQR} = 69{,}000 - 40{,}500 = 28{,}500 \]
Find one and a half IQRs
Why: the walking distance for each fence.
\[ 1.5(28{,}500) = 42{,}750 \]
Place the lower fence
Why: down from Q1.
\[ 40{,}500 - 42{,}750 = -2{,}250 \]
Place the upper fence
Why: up from Q3.
\[ 69{,}000 + 42{,}750 = 111{,}750 \]
Figure (svg): A dot plot of eleven salaries in thousands of dollars on an axis from 20 to 130: 28, 33, 40.5, 42, 54 twice, 64.5, 68.5, 69, 72 and 120. A blue band covers Q1 = 40.5 to Q3 = 69. A dashed red line marks the upper fence at 111.75, and the dot at 120 beyond it is red.
A negative salary is impossible, so again nothing can be flagged low. On the high side, the next-highest salary is 72,000, comfortably inside the fence, but 120,000 is more than 8 thousand dollars beyond it.
Check the extremes against the fences
Why: the smallest salary against the lower fence, the two largest against the upper one.
\[ 28{,}000 > -2{,}250, \quad 72{,}000 < 111{,}750, \quad 120{,}000 > 111{,}750 \]
So 120,000 dollars is a potential outlier. In context, it might be a manager's salary in a list of staff salaries, perfectly genuine but from a different kind of job, which is exactly the kind of thing investigation should find out.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Try It 2.13
Concept
The book chooses its words with care. The rule produces potential outliers, and potential outliers always require further investigation. Its note explains why: these special data points may be errors or some kind of abnormality, or they may be a key to understanding the data.
In every case the next step is to look at where the value came from, never to delete it on sight. A rule that only uses the data cannot tell these three cases apart; only knowledge of how the data were collected can.
\[ \text{flagged} \;\Rightarrow\; \text{investigate} \qquad \text{flagged} \;\not\Rightarrow\; \text{delete} \]
The book's note puts the third case memorably: a potential outlier may be a key to understanding the data. Some important findings began as a value someone was tempted to throw away.
And the rule can miss things too. A value inside the fences can still be a typing error, say a test score of 59 recorded as 95. The 1.5 IQR rule is a flashlight pointed at the far ends of the data, not a full audit.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — the Note on potential outliers
Concept
Example 2.14 reports its classes with five numbers in a row, and the next section, on box plots, draws a picture from exactly those five. They summarise where a data set sits and how it spreads, using nothing but places in the ordered list.
five-number summary — The minimum, the first quartile, the median, the third quartile and the maximum of a data set, in that order.
\[ \text{Min} \le Q_1 \le \text{Median} \le Q_3 \le \text{Max} \]
For the fourteen values of Part 1, the five numbers are 1, 2, 7, 9 and 11.5. Between each neighbouring pair sits about a quarter of the data, so four gaps hold four quarters.
\[ 1, \quad 2, \quad 7, \quad 9, \quad 11.5 \]
The summary is built for comparing groups. Put two five-number summaries side by side, as Table 2.22 does for the day and evening classes, and you can compare their centres, their middle halves and their extremes at a glance.
Two spreads can be read off it at once. The range is the last minus the first, 10.5; the IQR is the fourth minus the second, 7. When the range is much bigger than the IQR, the ends of the data are stretched out, and that is where the fences are worth computing.
\[ \text{range} = 11.5 - 1 = 10.5, \qquad \text{IQR} = 9 - 2 = 7 \]
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Table 2.22
Worked example
Example 2.14 compares test scores from a day class and an evening class of college statistics. The book prints the five-number summaries without the working; here is the working for the twenty day-class scores.
Order the twenty scores
Why: smallest to largest; the first ten form the lower half.
\[ 32,\ 32,\ 45,\ 55.5,\ 56,\ 56,\ 59,\ 68,\ 70,\ 72 \]
Continue with the upper half
Why: places 11 to 20.
\[ 77,\ 78,\ 79,\ 80,\ 81,\ 84,\ 84.5,\ 90,\ 90,\ 99 \]
Find the median
Why: twenty values, so place 10.5: average the 10th and 11th.
\[ \text{Median} = \dfrac{72 + 77}{2} = \dfrac{149}{2} = 74.5 \]
Find Q1
Why: the lower half has ten values; average its 5th and 6th.
\[ Q_1 = \dfrac{56 + 56}{2} = 56 \]
Find Q3
Why: the upper half's 5th and 6th values, places 15 and 16.
\[ Q_3 = \dfrac{81 + 84}{2} = \dfrac{165}{2} = 82.5 \]
No day student scored 74.5 or 82.5. With an even count, the median and quartiles are allowed to sit in gaps. Q1 came out as a real score only because two students both scored 56, straddling the middle of the lower half.
Check against Table 2.22
Why: the book's day row reads 32, 56, 74.5, 82.5, 99.
\[ \text{Min} = 32, \; Q_1 = 56, \; M = 74.5, \; Q_3 = 82.5, \; \text{Max} = 99 \;\checkmark \]
All five agree. In context: the middle half of the day class scored between 56 and 82.5, and a typical day student scored about 74.5 out of 100.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Example 2.14 and Table 2.22
Worked example
Now the evening class: twenty-two scores. Twenty-two is even, so the median is again an average, and each half has eleven values, an odd number, so each quartile is a single score.
Order the lower half
Why: the eleven smallest scores.
\[ 25.5,\ 45,\ 65,\ 68,\ 76,\ 78,\ 78,\ 79,\ 79,\ 80,\ 81 \]
Order the upper half
Why: places 12 to 22.
\[ 81,\ 83,\ 84.5,\ 85,\ 88,\ 89,\ 90,\ 90,\ 98,\ 98,\ 98 \]
Find the median
Why: place 11.5: average the 11th and 12th scores.
\[ \text{Median} = \dfrac{81 + 81}{2} = 81 \]
Find Q1
Why: the middle of eleven is the 6th value of the lower half.
\[ Q_1 = 78 \]
Find Q3
Why: the 6th value of the upper half, which is place 17 overall.
\[ Q_3 = 89 \]
Look at how the two halves differ. The lower half stretches from 25.5 to 81, more than 55 points, but almost all of that stretch comes from its two lowest scores. Its middle values, 76 to 80, are bunched just like the upper half's.
Check against Table 2.22
Why: the book's night row reads 25.5, 78, 81, 89, 98.
\[ \text{Min} = 25.5, \; Q_1 = 78, \; M = 81, \; Q_3 = 89, \; \text{Max} = 98 \;\checkmark \]
All five agree. In context: the middle half of the evening class scored between 78 and 89, and a typical evening student scored about 81, higher than the typical day student.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Example 2.14 and Table 2.22
Worked example
With both summaries in hand, the book asks for each class's interquartile range, a comparison, and any outliers.
The day class's IQR
Why: Q3 minus Q1.
\[ \text{IQR}_{\text{day}} = 82.5 - 56 = 26.5 \]
The night class's IQR
Why: the same subtraction.
\[ \text{IQR}_{\text{night}} = 89 - 78 = 11 \]
The day class's middle half is spread over 26.5 points, more than twice the night class's 11. The book's conclusion: more variation will be found in the day class's test scores.
The day class's fences
Why: one and a half IQRs is 39.75.
\[ 56 - 1.5(26.5) = 16.25, \qquad 82.5 + 1.5(26.5) = 122.25 \]
The night class's fences
Why: one and a half IQRs is 16.5.
\[ 78 - 1.5(11) = 61.5, \qquad 89 + 1.5(11) = 105.5 \]
Figure (svg): Two dot plots on a shared axis of test scores from 10 to 125. Top, the day class: twenty scores from 32 to 99 with a wide blue band from Q1 = 56 to Q3 = 82.5 and dashed red fences at 16.25 and 122.25, far outside every score. Bottom, the night class: twenty-two scores bunched between 65 and 98, a narrow blue band from 78 to 89, dashed red fences at 61.5 and 105.5, and the two scores 25.5 and 45 drawn in red below the lower fence.
The ranges would have told the opposite story: 67 points for the day class and 72.5 for the night class, as if the night class were more variable. The range was pulled out by two scores; the IQR describes the bulk.
Check every extreme against its class's fences
Why: day scores run from 32 to 99; the two lowest night scores are 25.5 and 45, and the next is 65.
\[ 16.25 < 32, \; 99 < 122.25; \qquad 25.5 < 61.5, \; 45 < 61.5, \; 65 > 61.5 \]
The day class has no outliers. The night class has two, 25.5 and 45, both low, and none above 105.5. Those two students are the ones to ask about: a missed section, an illness, or a recording slip.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Example 2.14
Comparison
Fill in the blanks from Example 2.14. Then read down each column: every number in the night column is a consequence of its narrow box.
Comparison matrix
| measure | day class | night class |
|---|---|---|
| Q1 | 56 | 78 |
| Q3 | 82.5 | 89 |
| IQR | 26.5 | 11 |
| 1.5 times IQR | 39.75 | 16.5 |
| lower fence | 16.25 | 61.5 |
| upper fence | 122.25 | 105.5 |
| potential outliers | none | 25.5 and 45 |
The day class's upper fence, 122.25, is above the highest possible score on a test out of 100, so the rule could never flag a high day score however well someone did. A wide box buys its data a lot of room.
\[ \dfrac{26.5}{11} \approx 2.41 \]
Each blank can be filled from the numbers in the same column, which is a good way to check yourself: the IQR from the two quartiles, the fence distance from the IQR, and each fence from its quartile and that distance.
The day box is about two and a half times as wide as the night box, and so is every fence distance. That single ratio explains why the same rule flags two night scores and no day scores, even though the lowest day score, 32, is lower than most night scores.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Example 2.14
Worked example
Try It 2.14 asks for the interquartile ranges of two more classes of twenty test scores, and a comparison. Twenty is even, so each half has ten scores and each quartile averages a pair.
Order class A's lower half
Why: the ten smallest scores; Q1 averages the 5th and 6th.
\[ 65,\ 66,\ 67,\ 69,\ \boxed{69},\ \boxed{76},\ 77,\ 77,\ 79,\ 80 \;\Rightarrow\; Q_1 = \dfrac{69 + 76}{2} = 72.5 \]
Order class A's upper half
Why: places 11 to 20; Q3 averages the 15th and 16th.
\[ 81,\ 83,\ 85,\ 89,\ \boxed{90},\ \boxed{91},\ 94,\ 96,\ 98,\ 99 \;\Rightarrow\; Q_3 = 90.5 \]
Class A's IQR
Why: Q3 minus Q1.
\[ \text{IQR}_A = 90.5 - 72.5 = 18 \]
Class B's quartiles
Why: the same places in class B's ordered list: 72 and 73 in the lower half, 92 and 95 in the upper.
\[ Q_1 = \dfrac{72 + 73}{2} = 72.5, \qquad Q_3 = \dfrac{92 + 95}{2} = 93.5 \]
Class B's IQR
Why: Q3 minus Q1.
\[ \text{IQR}_B = 93.5 - 72.5 = 21 \]
Figure (svg): Two dot plots of twenty test scores each on an axis from 60 to 102. Class A, top: scores from 65 to 99 with a blue band from Q1 = 72.5 to Q3 = 90.5. Class B, bottom: scores from 68 to 100 with a blue band from 72.5 to 93.5, and a visible gap between 80 and 90 where no class B student scored.
Class B's middle half is 3 points wider. The picture shows where that comes from: class B has a gap between 80 and 90, with no students there at all, which pushes its upper half up into the 90s.
Check for outliers and confirm the comparison
Why: the fences for each class, against its lowest and highest scores.
\[ A: 45.5 < 65, \; 99 < 117.5; \qquad B: 41 < 68, \; 100 < 125 \]
Neither class has an outlier. The book prints no answer, so here it is in context: class B's middle half of scores is spread over 21 points against class A's 18, so class B's typical scores vary a little more.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 88-89 — Try It 2.14
Error analysis
Four students compute a lower fence for the night class, with Q1 = 78, median 81, Q3 = 89, range 72.5 and IQR 11. Only one follows the rule. Find each flaw before opening the notes.
Annotate
On: \( 78 - 1.5(72.5), \quad 81 - 1.5(11), \quad 1.5(78 - 11), \quad 78 - 1.5(11) \)
The first error is the most instructive. A rule based on the range is stretched by the very values it is supposed to judge, so it can never flag them. That is the whole reason for using the IQR.
\[ 78 - 1.5(11) = 78 - 16.5 = 61.5 \]
Notice that every attempt did its arithmetic correctly. The errors are all in the set-up: the wrong ruler, the wrong starting point, the wrong order of operations. That is typical of this section, where the formulas are short and the mistakes come from not saying what each number means.
A quick sanity check catches the other two. A lower fence should be below Q1 and, for an ordinary data set, not far below the bulk of the data. A fence at 100.5 is above Q1, which is impossible for a lower fence.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 88 — Example 2.14
Discrimination
Imagine six new evening students sit the same test. Their class's fences stay at 61.5 and 105.5 for this exercise. Decide, score by score, what the rule says.
Sort into buckets
Sort each new score by whether the 1.5 IQR rule, with fences 61.5 and 105.5, flags it.
Two items deserve a second look. The score on the fence is not flagged, because the book's rule says less than, not less than or equal to. And 61 is flagged while 62 is not, though they differ by a single point: a fence is a sharp line drawn through a gradual change.
Notice too that the fences were held fixed with the new students added. In a real analysis they would be recomputed, and six extra scores could move Q1 and Q3 a little. Holding them fixed isolates the one skill practised here: comparing a value with a fence, strictly.
That sharpness is why the label is potential outlier. A score of 61 is not a different kind of score from 62; it is a score close enough to the edge that someone should glance at it.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 87 — the 1.5 IQR rule
Section
Part 3
Concept
Quartiles cut ordered data into quarters. Percentiles cut it into hundredths, using the same idea: a percentile is a value of the variable with a known percent of the data at or below it.
kth percentile — A value such that about k percent of the ordered data are the same as or less than it, and about the remaining percent are the same as or greater than it.
The book's example is the one people get wrong most often. To score in the 90th percentile of an exam does not necessarily mean that you received 90 percent on the test. It means that 90 percent of test scores are the same as or less than your score, and 10 percent are the same as or greater.
\[ \text{90th percentile} = \text{a score with } 90\% \text{ of scores at or below it} \]
Percentiles are useful for comparing values, which is why universities use them so much. The book's example: suppose Duke accepts SAT scores at or above the 75th percentile, which translates into a score of at least 1220. The percentile is the policy; 1220 is the value it points at.
Percentiles are mostly used with very large populations, the book adds, and with a million test-takers it makes no practical difference whether you say at or below, or strictly below. Removing one particular data value is not significant. With twenty-nine values, as in the examples that follow, it does make a difference, and the formulas say exactly how ties are treated.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 86 — percentiles
Picture it
A percentile measures a value against the other values, not against the maximum possible score. The evening class of Example 2.14 makes the point with real data.
Figure (svg): A dot plot of the twenty-two night-class scores from 25.5 to 98 on an axis from 20 to 100. The five scores below 78 are drawn in blue, the two scores of exactly 78 in yellow, and the fifteen scores above 78 in grey. A yellow line rises from 78, labelled 78 points.
A night student who scored 78 answered 78 percent of the test correctly. But in this class only 5 students scored lower, 2 scored exactly 78, and 15 scored higher. Counting the lower five in full and the tied pair as half gives the share at or below.
\[ \dfrac{5 + 0.5(2)}{22} \times 100 = \dfrac{6}{22} \times 100 \approx 27.3 \]
So 78 is at about the 27th percentile, which matches what you already know: 78 is Q1 for this class, and Q1 is the 25th percentile. Part 5 derives this counting formula properly; here, notice only how different 78 and 27 are.
The same 78 in the day class would sit at about the 58th percentile, because the day class scored lower overall. A percentile has no meaning until you know the group it is measured against, which is why the book's interpretation sentences always name the group.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 86 and 88 — percentiles and Example 2.14
Trap
A report says: your daughter scored at the 70th percentile on the 20-question test.
A parent reads it as:
\[ 70\% \text{ of } 20 = 14 \text{ correct} \]
and worries that she got 6 of the 20 wrong.
A percentile ranks her against the other students. Example 2.20 gives the value:
\[ \text{70th percentile} = 16 \text{ correct} \]
\[ \dfrac{16}{20} = 80\% \text{ correct} \]
70 percent of students answered 16 or fewer correctly; 30 percent answered 16 or more.
Matching
The quartiles are not a separate idea from percentiles; they are three particular percentiles with their own names. The book uses this in Example 2.15 and Example 2.17, where it finds a quartile by asking for the matching percentile. Match each measure to its percentile description.
Match the pairs
Why: About a quarter of the data lie at or below Q1, so it is the 25th percentile; half lie at or below the median, the 50th; three quarters lie at or below Q3, the 75th. The IQR is not a location at all but a distance, Q3 minus Q1, the gap between the 25th and 75th percentiles.
\[ Q_1 = P_{25}, \quad \text{median} = P_{50}, \quad Q_3 = P_{75}, \quad \text{IQR} = P_{75} - P_{25} \]
The last pair is the odd one out. Three of these measures are values the variable takes, in its units, with a share of the data below them. The IQR is a width, also in the data's units, but with no share attached: it is how far apart two locations are.
This matching matters for calculation. Whenever a question asks for a quartile and gives you a frequency table instead of a list, you can turn it into a percentile question and use the tools of Parts 3 and 4.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 89-91 — Examples 2.15 and 2.17
Concept
Example 2.15 hands you a frequency table rather than a list: fifty statistics students reporting how much sleep they get per school night, rounded to the nearest hour. The last column, cumulative relative frequency, does most of the work.
| hours | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|
| frequency | 2 | 5 | 7 | 12 | 14 | 7 | 3 |
| cumulative RF | 0.04 | 0.14 | 0.28 | 0.52 | 0.80 | 0.94 | 1.00 |
Each cumulative entry is the share of students sleeping that many hours or fewer. For 6 hours, the two 4s, five 5s and seven 6s make 14 students, and 14 of 50 is 0.28.
\[ \dfrac{2 + 5 + 7}{50} = \dfrac{14}{50} = 0.28 \]
Figure (svg): A bar chart of cumulative relative frequency for hours of sleep 4 to 10: bars of height 0.04, 0.14, 0.28, 0.52, 0.80, 0.94 and 1.00, written above each bar. Horizontal dashed lines cross at 0.28 in orange, 0.50 in yellow and 0.75 in green; the 0.75 line passes between the tops of the 7-hour and 8-hour bars.
So the cumulative column is a list of percentiles in disguise: 28 percent of the students sleep 6 hours or less, 52 percent sleep 7 hours or less. To find a given percentile, run your eye down the column to the first entry that reaches the percent you want.
The 75th percentile is the clearest case. The column jumps from 0.52 at 7 hours to 0.80 at 8 hours, passing 0.75 on the way, so the 75th percentile must be an 8. The book calls this eyeballing, and the worked examples confirm it by counting.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 89 — Example 2.15 and Table 2.23
Worked example
Use the sleep table to find the 28th percentile and the median, following the book's counting argument, which works in places along the ordered list of fifty values.
Find 28 percent of the data count
Why: the cumulative entry for 6 hours is exactly 0.28.
\[ 0.28 \times 50 = 14 \text{ values} \]
Identify those 14 values
Why: the two 4s, the five 5s and the seven 6s fill places 1 to 14.
\[ 2 + 5 + 7 = 14 \]
Locate the 28th percentile
Why: it sits between place 14, the last 6, and place 15, the first 7; the book takes the halfway point.
\[ \dfrac{6 + 7}{2} = 6.5 \]
Figure (svg): Fifty numbered boxes in two rows of twenty-five, holding the sleep data in order: two 4s, five 5s, seven 6s, twelve 7s, fourteen 8s, seven 9s and three 10s. An orange cut between places 14 and 15 is labelled 28th percentile 6.5; a yellow cut between places 25 and 26 is labelled median 7; a green ring around place 38 is labelled Q3 8.
Find half of the data count for the median
Why: the median is the 50th percentile.
\[ 0.50 \times 50 = 25 \]
Locate the median
Why: places 25 and 26 are both 7s: the 4s, 5s and 6s fill 14 places and the twelve 7s fill places 15 to 26.
\[ \text{median} = \dfrac{x_{(25)} + x_{(26)}}{2} = \dfrac{7 + 7}{2} = 7 \]
The 28th percentile, 6.5 hours, is not an amount anyone reported, since the answers were rounded to whole hours. It is a cut between the sixes and the sevens, which is exactly what a percentile is allowed to be.
Check with the cumulative column
Why: 28 percent sleep 6 hours or less and 52 percent sleep 7 or less, so the 50 percent mark must fall among the 7s.
\[ 0.28 < 0.50 \le 0.52 \;\Rightarrow\; \text{median} = 7 \]
Both answers agree with the book. In context: 28 percent of these students sleep 6.5 hours or less per school night, and half sleep 7 hours or less.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 89 — Example 2.15
Worked example
The third quartile is the 75th percentile. The book finds it twice, once by eye and once by counting, and the two must agree.
Eyeball it from the cumulative column
Why: with all the 4s, 5s, 6s and 7s you have 52 percent of the data; with the 8s you reach 80 percent.
\[ 0.52 < 0.75 < 0.80 \;\Rightarrow\; Q_3 = 8 \]
Count instead: 75 percent of 50
Why: a place in the ordered list.
\[ 0.75 \times 50 = 37.5 \]
Round the place up
Why: the book rounds 37.5 up to 38 and reads that place.
\[ 37.5 \;\to\; 38 \]
Read place 38
Why: the 8s fill places 27 to 40, so place 38 is an 8.
\[ x_{(38)} = 8 \]
The book adds a check by counting values: there are 37 values below the third quartile and 12 above. Read that carefully, because it counts places, not values. By value, only 26 students sleep less than 8 hours and 10 sleep more; the other 14 sleep exactly 8.
\[ \text{by place: } 37 \text{ below}, \; 12 \text{ above} \qquad \text{by value: } 26 < 8, \; 14 = 8, \; 10 > 8 \]
Check with the halves method of Part 1
Why: the upper half is places 26 to 50, twenty-five values, and its middle is its 13th, place 38.
\[ Q_3 = x_{(38)} = 8 \]
Every route gives 8 hours. In context: three quarters of these fifty students sleep 8 hours or less on a school night, and a quarter sleep 8 or more.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 89 — Example 2.15
Worked example
Forty bus drivers report how many hours they spend each day running their routes, rounded to the nearest hour. Find the 65th percentile, using the same reasoning as Example 2.15.
| hours | 2 | 3 | 4 | 5 |
|---|---|---|---|---|
| frequency | 12 | 14 | 10 | 4 |
| cumulative RF | 0.30 | 0.65 | 0.90 | 1.00 |
Find 65 percent of forty
Why: the cumulative column already shows 0.65 at 3 hours.
\[ 0.65 \times 40 = 26 \text{ values} \]
Identify those 26 values
Why: the twelve 2s and the fourteen 3s fill places 1 to 26.
\[ 12 + 14 = 26 \]
Locate the cut
Why: the 65th percentile sits between place 26, the last 3, and place 27, the first 4.
\[ \dfrac{3 + 4}{2} = 3.5 \]
Figure (svg): Forty numbered boxes in two rows holding the bus drivers' hours in order: twelve 2s, fourteen 3s, ten 4s and four 5s. An orange cut between places 26 and 27, the last 3 and the first 4, is labelled 65th percentile 3.5; a green ring around places 30 and 31, both 4s, is labelled Q3 4.
This is the same situation as the 28th percentile of the sleep data: the percent lands exactly on a cumulative entry, so the cut falls between two different values, and the percentile is halfway between them.
Check with the index formula of Part 4
Why: the index is 65 hundredths of n plus 1; it falls between places 26 and 27.
\[ i = 0.65(40 + 1) = 26.65 \;\Rightarrow\; \dfrac{x_{(26)} + x_{(27)}}{2} = \dfrac{3 + 4}{2} = 3.5 \]
Both methods give 3.5 hours. The book prints no answer, so here it is in context: 65 percent of these drivers spend 3.5 hours or less a day on their routes, and 35 percent spend 3.5 hours or more.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 89-90 — Try It 2.15 and Table 2.24
Section
Part 4
Concept
Counting by eye works for a table, but you need a rule you can apply to any list. The book admits there are several formulas for the kth percentile, and gives one of them. Its idea is to turn the percent into a place, called the index.
\[ i = \left(\dfrac{k}{100}\right)(n + 1) \]
Why n plus 1 and not n? Picture the n ordered values as posts along a road. They divide it into n plus 1 stretches: one before the first value, one between each pair, and one after the last. Each value then marks a fraction of the road, its place over n plus 1.
\[ \text{place } i \;\leftrightarrow\; \dfrac{i}{n + 1} \text{ of the way along} \]
With n = 29, the 15th value is exactly halfway, since 15 over 30 is one half, and the median is indeed the 15th of 29. Using n instead would put the median at place 14.5, which is wrong for an odd count. The n plus 1 makes the formula agree with the median you already know.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 90 — a formula for finding the kth percentile
Notation
Three letters, three different kinds of number. Keep them apart and the formula is mechanical.
Annotate
On: \( i = \left(\dfrac{k}{100}\right)(n + 1) \)
The commonest slip is to report i itself as the answer. For the actors, the 70th percentile has index 21, but the 70th percentile is 64 years, the age in place 21. The index is an address, and the answer is whoever lives there.
\[ i = 21 \;\longrightarrow\; x_{(21)} = 64 \text{ years} \]
Once more on k: it never appears in the answer. Whether you are asked for the 70th or the 83rd percentile, the answer is an age, and k only decides which age. If your answer is a number between 0 and 100 with no units, check that you have not stopped at the index or at k itself.
Units help here. The index has no units, because it counts places; the percentile has the units of the data, years.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 90 — the definitions of k, i and n
Worked example
Example 2.16 lists, in order, the ages of 29 Academy Award winning best actors. Find the 70th and 83rd percentiles.
\[ 18,\ 21,\ 22,\ 25,\ 26,\ 27,\ 29,\ 30,\ 31,\ 33,\ 36,\ 37,\ 41,\ 42,\ 47 \]
\[ 52,\ 55,\ 57,\ 58,\ 62,\ 64,\ 67,\ 69,\ 71,\ 72,\ 73,\ 74,\ 76,\ 77 \]
(a) Compute the index for k = 70
Why: n is 29, so n plus 1 is 30.
\[ i = \left(\dfrac{70}{100}\right)(29 + 1) = 0.7 \times 30 = 21 \]
Read place 21
Why: 21 is a whole number, so the percentile is the value in that place.
\[ x_{(21)} = 64 \;\Rightarrow\; P_{70} = 64 \text{ years} \]
(b) Compute the index for k = 83
Why: the same formula.
\[ i = \left(\dfrac{83}{100}\right)(30) = 24.9 \]
Round down and up
Why: 24.9 is not whole, so use places 24 and 25.
\[ x_{(24)} = 71, \qquad x_{(25)} = 72 \]
Average the two values
Why: the book averages; it does not round 24.9 to 25.
\[ P_{83} = \dfrac{71 + 72}{2} = 71.5 \text{ years} \]
Figure (svg): A scatter of the 29 ordered ages against their place in the list, from (1, 18) up to (29, 77), rising like a staircase. A dashed vertical line at place 21 meets the dot at age 64. A second dashed line at place 24.9 falls between the dots at place 24, age 71, and place 25, age 72; a yellow mark on the line between them is at 71.5.
Check by counting
Why: the 70th percentile should have about 70 percent of the 29 ages at or below it.
\[ \#(\le 64) = 21, \qquad \dfrac{21}{29} \approx 0.724 \]
About 72 percent of the ages are 64 or less, close to 70 percent. In context: 70 percent of these best actors were 64 or younger when they won, and 83 percent were 71.5 or younger.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 90 — Example 2.16
Trap
For the 83rd percentile a student computes the index correctly:
\[ i = 0.83(30) = 24.9 \]
then rounds to the nearest place:
\[ 24.9 \to 25 \;\Rightarrow\; 72 \]
and reports 72 years.
A non-whole index means: average both neighbours.
\[ x_{(24)} = 71, \quad x_{(25)} = 72 \]
\[ \dfrac{71 + 72}{2} = 71.5 \]
The book's rule averages the two places, however close i is to one of them.
Here the difference is half a year; with widely spaced data it can be large.
Tweak it
The index is a straight line in k: double the percent and the place doubles. Its slope is n plus 1 over 100, so a bigger data set stretches the same percent over more places. Use the slider to see both effects.
Parameter explorer
With n = 29, read the index at k = 70 and at k = 83. Then find a value of k between 1 and 99 that gives a whole-number index. Finally set n to 50, the sleep data, and read the index at k = 80.
\[ i = \dfrac{k}{100} \times ({n} + 1) \]
What to notice: with 29 values, n plus 1 is 30, so every multiple of ten percent lands on a whole place. The 10th percentile is place 3 and the 20th is place 6, which is why Try It 2.16's 20th percentile will come out as a single age.
\[ \dfrac{10}{100}(30) = 3, \qquad \dfrac{20}{100}(30) = 6, \qquad \dfrac{80}{100}(51) = 40.8 \]
With 50 values, n plus 1 is 51, and almost no percent gives a whole index. Then nearly every percentile is an average of two neighbours, as in Example 2.17. The formula is the same; whether you average depends on the arithmetic, not on the question.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 90-91 — the index formula
Worked example
Try It 2.16 uses the same 29 ages and asks for the 20th and 55th percentiles. The book prints no answers; work them out with the index formula and check each by counting.
Index for k = 20
Why: n plus 1 is still 30.
\[ i = \left(\dfrac{20}{100}\right)(30) = 6 \]
Read place 6
Why: a whole index, so take that value.
\[ 18,\ 21,\ 22,\ 25,\ 26,\ \boxed{27} \;\Rightarrow\; P_{20} = 27 \text{ years} \]
Index for k = 55
Why: the same move.
\[ i = \left(\dfrac{55}{100}\right)(30) = 16.5 \]
Average places 16 and 17
Why: 16.5 is not whole; place 16 holds 52 and place 17 holds 55.
\[ P_{55} = \dfrac{52 + 55}{2} = 53.5 \text{ years} \]
Notice that 53.5 is not anyone's age, and it does not need to be. It marks the cut between the 16th and 17th winners, and any value in the gap from 52 to 55 would split the list the same way; the formula picks the midpoint.
Check both by counting
Why: the share of ages at or below each answer should be close to 20 and 55 percent.
\[ \dfrac{\#(\le 27)}{29} = \dfrac{6}{29} \approx 0.207, \qquad \dfrac{\#(\le 53.5)}{29} = \dfrac{16}{29} \approx 0.552 \]
Both shares are within a percentage point of the targets. In context: 20 percent of these best actors were 27 or younger when they won, and 55 percent were 53.5 or younger.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 90-91 — Try It 2.16
Worked example
Example 2.17 returns to the sleep table of fifty students and uses the index formula instead of eyeballing. With n = 50, n plus 1 is 51. The cumulative counts tell you where each value's places run: 4s fill places 1 to 2, 5s 3 to 7, 6s 8 to 14, 7s 15 to 26, 8s 27 to 40, 9s 41 to 47 and 10s 48 to 50.
(a) Index for the 80th percentile
Why: 80 hundredths of 51.
\[ i = \left(\dfrac{80}{100}\right)(51) = 40.8 \]
Read places 40 and 41
Why: place 40 is the last 8 and place 41 the first 9.
\[ x_{(40)} = 8, \qquad x_{(41)} = 9 \]
Average them
Why: a non-whole index.
\[ P_{80} = \dfrac{8 + 9}{2} = 8.5 \]
(b) Index for the 90th percentile
Why: 90 hundredths of 51.
\[ i = \left(\dfrac{90}{100}\right)(51) = 45.9 \]
Read and average places 45 and 46
Why: both lie in the run of 9s, places 41 to 47.
\[ P_{90} = \dfrac{9 + 9}{2} = 9 \]
Figure (svg): The same fifty ordered sleep values in two rows of numbered boxes. A green ring encloses places 12 and 13, both 6s, labelled first quartile; an orange cut between places 40 and 41, an 8 and a 9, is labelled 80th percentile 8.5; a blue ring encloses places 45 and 46, both 9s, labelled 90th percentile.
The averaging rule only produces a new number when the two neighbours differ. At the 80th percentile the index falls on the boundary between the 8s and the 9s, so you get 8.5. At the 90th it falls inside the run of 9s, so you get 9.
Check against the cumulative column
Why: 80 percent sleep 8 hours or less, so the 80th percentile should be at the top of the 8s; 94 percent sleep 9 or less, so the 90th should be a 9.
\[ 0.80 \to 8 \text{ to } 9 \text{ boundary}, \qquad 0.80 < 0.90 \le 0.94 \to 9 \]
Both agree with the book. In context: 80 percent of the students sleep 8.5 hours or less per school night, and 90 percent sleep 9 hours or less.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 91 — Example 2.17
Worked example
Part (c) of Example 2.17 asks for the first quartile of the sleep data and for another name for it. Try It 2.17 asks the same question about the third quartile of the bus drivers' table.
Name Q1 as a percentile
Why: the first quartile is the 25th percentile.
\[ Q_1 = P_{25} \]
Index for the sleep data
Why: 25 hundredths of 51.
\[ i = \left(\dfrac{25}{100}\right)(51) = 12.75 \]
Read places 12 and 13
Why: both lie in the run of 6s, places 8 to 14.
\[ Q_1 = \dfrac{6 + 6}{2} = 6 \text{ hours} \]
Try It 2.17: index for Q3 of the drivers
Why: the third quartile is the 75th percentile, and n plus 1 is 41.
\[ i = \left(\dfrac{75}{100}\right)(41) = 30.75 \]
Read places 30 and 31
Why: the drivers' 4s fill places 27 to 36.
\[ Q_3 = \dfrac{4 + 4}{2} = 4 \text{ hours} \]
Both quartiles are whole numbers of hours because both indexes land inside a long run of equal values. That is typical of frequency tables with few distinct values: the averaging step rarely changes anything except at a boundary between runs.
Check each quartile by the halves method
Why: sleep: the lower half is places 1 to 25, middle place 13; drivers: the upper half is places 21 to 40, middle pair 30 and 31.
\[ \text{sleep: } x_{(13)} = 6, \qquad \text{drivers: } \dfrac{x_{(30)} + x_{(31)}}{2} = 4 \]
Both methods agree. In context: a quarter of the students sleep 6 hours or less, and three quarters of the bus drivers spend 4 hours or less a day on their routes. The other name the book asks for: Q3 is the 75th percentile.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 91 — Example 2.17(c) and Try It 2.17
Counterexample
You now have two ways to find a quartile: the median of a half, from Part 1, and the index formula with k = 25 or 75. For the houses, the actors, the sleep data and the drivers they gave the same answer. Here is a claim you might draw: the two methods always agree.
Discussion prompt
Test the claim on the fourteen values of Part 1, 1, 1, 2, 2, 4, 6, 6.8, 7.2, 8, 8.3, 9, 10, 10, 11.5. Compute Q3 both ways. Does the claim survive?
Neither answer is wrong. Both 9 and 9.5 have eleven of the fourteen values at or below them, close to the three-quarters target of 10.5. The two methods are different conventions for where to cut inside a gap, and the book itself says there are several formulas for percentiles.
\[ \#(\le 9) = 11, \qquad \#(\le 9.5) = 11, \qquad 0.75 \times 14 = 10.5 \]
The practical lesson is to say which method you used, and to expect small differences from calculators and spreadsheets. With large data sets the methods differ by less and less, which is one reason the book says percentiles are mostly used with very large populations.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 87 and 90 — the quartiles and the index formula
Fill the middle
One more run of the index formula, this time on the 29 actors' ages, with the blanks for you to fill. The 7th and 8th ages in the ordered list are 29 and 30.
Fill in the blanks
i = \dfrac7.57(29 + 1) = 8 \;\Rightarrow\; Q_1 = \dfrac29.5})} + x____})}}___ = \dfrac______ = ___
Why: Twenty-five hundredths of 30 is 7.5, which is not a whole number, so round down to place 7 and up to place 8. Those hold 29 and 30, and their average is 29.5 years.
Check it the Part 1 way. With 29 values the median is place 15, and the lower half is places 1 to 14. Its middle pair is its 7th and 8th values, the same 29 and 30, so the halves method also gives 29.5. Here the two methods agree.
\[ \text{lower half: } 18, \dots, 42 \; (14 \text{ values}) \;\Rightarrow\; \dfrac{29 + 30}{2} = 29.5 \]
In context: a quarter of these best actors were 29.5 or younger when they won. Combine it with the 75th percentile, 68, and the middle half of winners were between 29.5 and 68, an IQR of 38.5 years. That wide spread is worth remembering when Section 2.4 draws this data as a box plot.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 90 — Example 2.16's data
Section
Part 5
Concept
Part 4 went from a percent to a value. Now reverse it: you are given a value and asked for its percentile. The book's formula counts places in the ordered list, and it has one subtle feature, the treatment of ties.
\[ \text{percentile} = \dfrac{x + 0.5y}{n}(100), \quad \text{rounded to the nearest whole number} \]
Figure (svg): The 29 actors' ages as dots on a number line from 15 to 80. The eighteen ages below 58 are blue, the single age 58 is yellow, and the ten ages above 58 are grey. Labels read 18 below, 1 equal and 10 above.
Why only half of the equal values? A percentile is meant to sit in the middle of its value's own block of places. Counting all of the ties as below would place the value at the top of its block, and counting none would place it at the bottom. Half splits the difference fairly.
For a value that occurs once, y is 1, and the value contributes half of itself: it is treated as half below its own position and half above. That is why no value can have a percentile of exactly 0 or exactly 100 by this formula, a point the boundary slide returns to.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 92 — a formula for finding the percentile of a value
Notation
This formula looks like the index formula's mirror image, and each piece has a reason. Read it once as a sentence: the share of the data below the value, with ties split down the middle, as a percent.
Annotate
On: \( \dfrac{x + 0.5y}{n}(100) \)
The rounding at the end matters for reporting, because percentiles are named by whole numbers: the 64th, the 12th. Keep the unrounded value while you check your work, and round only when you write the final sentence.
The answer is a percentile, a number from 0 to 100 with no units of the data. That is the opposite of the index formula, whose answer is a data value in the data's units. Keep that difference in front of you and you will never mix the two formulas up.
\[ \text{index formula: percent} \to \text{value} \qquad \text{counting formula: value} \to \text{percent} \]
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 92 — the definitions of x, y and n
Worked example
Example 2.18 uses the same 29 ages of best actors and asks for the percentile of the age 58 and of the age 25.
(a) Count the ages below 58
Why: counting from the bottom of the list, 18 up to 57.
\[ 18, 21, 22, \dots, 55, 57 \;\Rightarrow\; x = 18 \]
Count the ages equal to 58
Why: 58 appears once.
\[ y = 1 \]
Apply the formula
Why: 18 below in full, the 58 itself as half.
\[ \dfrac{18 + 0.5(1)}{29}(100) = \dfrac{18.5}{29}(100) = 63.79 \]
Round to a whole percentile
Why: 63.79 rounds to 64.
\[ 58 \text{ is the 64th percentile} \]
(b) Count for 25
Why: three ages, 18, 21 and 22, are below 25, and 25 appears once.
\[ x = 3, \quad y = 1: \quad \dfrac{3 + 0.5}{29}(100) = \dfrac{3.5}{29}(100) = 12.07 \]
The book prints 63.80 in part (a). The exact value is 63.793 and so on, which rounds to 63.79 to two decimal places; the slip is in the second decimal place and does not change the percentile, which is the 64th either way.
Check by reversing with the index formula
Why: the 64th percentile's index should land near place 19, where 58 sits.
\[ i = 0.64(30) = 19.2 \;\Rightarrow\; \dfrac{x_{(19)} + x_{(20)}}{2} = \dfrac{58 + 62}{2} = 60 \]
The index lands just past place 19, and 58 is the value in place 19, so the two formulas point at the same spot; they differ only in how a gap is filled. In context: about 64 percent of these winners were younger than or the same age as 58, and 25 is the 12th percentile, a young winner.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 92 — Example 2.18
Worked example
Try It 2.18 adds a thirtieth actor, a second winner aged 31, and asks for the percentiles of 47 and of 31. The tie is the point of the exercise.
\[ 18,\ 21,\ 22,\ 25,\ 26,\ 27,\ 29,\ 30,\ 31,\ 31,\ 33,\ 36,\ 37,\ 41,\ 42,\ 47,\ \dots \]
Count for 47
Why: fifteen ages, from 18 to 42, are below 47, and 47 appears once; n is now 30.
\[ x = 15, \quad y = 1, \quad n = 30 \]
Apply the formula
Why: fifteen below, half of the one 47.
\[ \dfrac{15 + 0.5(1)}{30}(100) = \dfrac{15.5}{30}(100) = 51.67 \;\to\; 52 \]
Count for 31
Why: eight ages, 18 to 30, are below 31, and 31 appears twice.
\[ x = 8, \quad y = 2 \]
Apply the formula
Why: eight below, half of the two 31s.
\[ \dfrac{8 + 0.5(2)}{30}(100) = \dfrac{9}{30}(100) = 30 \]
Figure (svg): Thirty numbered boxes holding the ordered ages for Try It 2.18. The eight ages below 31 are blue, the two ages of 31 at places 9 and 10 are yellow, and the rest are grey. A green ring marks place 16, age 47, which has fifteen ages below it.
The two 31s occupy places 9 and 10. Counting one of them as below puts 31 at the boundary between places 9 and 10, exactly 9 places of 30 along, which is the 30th percentile. Counting neither would give 26.67, and counting both 33.33; half is the fair middle.
Check against the 29-age list
Why: adding a 31 moved 47 from x = 14 of 29 to x = 15 of 30.
\[ \dfrac{14.5}{29}(100) = 50 \quad \to \quad \dfrac{15.5}{30}(100) \approx 51.67 \]
In the original list 47 was the median, the 50th percentile; one more young winner pushes it to the 52nd. In context: 47 is the 52nd percentile of these thirty winners, and 31 the 30th. The book prints no answers; these are computed.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 92 — Try It 2.18
Edge cases
Every formula is worth testing at its extremes. Take the youngest and the oldest of the 29 actors, 18 and 77, and push both percentile formulas to their limits.
Discussion prompt
Find the percentiles of the youngest age, 18, and the oldest, 77, with the counting formula. Can any value be the 0th or the 100th percentile? Then try the index formula with k = 1 and k = 99, and say what it does near the ends.
Notice also how differently the two formulas fail. The counting formula always gives an answer, just never 0 or 100. The index formula can ask for a place that does not exist. That difference is one more sign that the two formulas are separate conventions rather than exact inverses, the subject of the next slide.
This is the book's remark about large populations again. With 29 values, the extreme percentiles are guesses; with a million values, the 1st and 99th percentiles are well defined, because there are ten thousand values in each tail.
\[ \dfrac{1}{29 + 1} \approx 0.033 \qquad \text{versus} \qquad \dfrac{1}{1{,}000{,}001} \approx 0.000001 \]
Concept
If the index formula takes you from a percent to a value, and the counting formula takes you from a value to a percent, you might expect a round trip to bring you home. Try it with Example 2.16.
\[ k = 70 \;\xrightarrow{\text{index}}\; 64 \;\xrightarrow{\text{count}}\; \dfrac{20 + 0.5}{29}(100) = 70.69 \to 71 \]
Seventy goes out and 71 comes back. Neither formula is wrong; they handle a single value differently. The index formula treats 64 as a point at place 21 of 30 stretches. The counting formula treats it as a block of one place, half below and half above.
\[ \dfrac{21}{30} = 0.70 \qquad \text{versus} \qquad \dfrac{20.5}{29} \approx 0.707 \]
The median is a happy exception. For the 29 ages, the 50th percentile by index is place 15, which is 47, and the counting formula gives 47 exactly the 50th percentile: fourteen below, one equal, 14.5 over 29.
\[ \dfrac{14 + 0.5}{29}(100) = 50 \]
The gap between the two formulas is at most about one place in n, so it shrinks as the data set grows. With small data sets, report the method and round sensibly; with the large populations percentiles are usually computed for, the difference disappears.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 90-92 — the two percentile formulas
Discrimination
The hardest part of a percentile question is often deciding which way it runs. Read what is given and what is asked: a percent given means you need a value; a value given means you need a percent.
Sort into buckets
Sort each question by the formula it needs.
The quartile question is the disguised one: it never says percent, but the third quartile is the 75th percentile, so it gives a percent and asks for a value. The SAT question is disguised the other way, asking for a share, which is a percentile.
Phrases help as well. At or below what value, the value at, which score marks, the cutoff for: these ask for a value. What percentile, what share, where does it rank, what percent scored lower: these ask for a percentile.
A quick test: look at the units of the answer. If the answer should be in years, hours, kilograms or points, use the index formula. If it should be a percentile, use the counting formula.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 90-92 — the two formulas
Section
Part 6
Concept
A percentile on its own is a number; an interpretation turns it into a statement about people or things. The book says that when you interpret a percentile in context, your sentence should contain four pieces of information.
The book also reminds you which way the scale runs. Low percentiles always correspond to lower data values, and high percentiles to higher data values. That sounds obvious, but it is separate from whether the value is good.
\[ \text{low percentile} \leftrightarrow \text{low value} \qquad \text{good or bad?} \to \text{depends on the context} \]
A percentile may or may not carry a value judgement. A low percentile for the time taken to finish a race is good, because low means fast. A low percentile for income may be bad. A low percentile for credit units enrolled is neither: it simply describes a part-time student. Say which, and why, only when the context supports it.
The book adds that interpreting percentiles properly matters not only for describing data but for the probability calculations in later chapters, where the same language describes areas under curves.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 92-93 — interpreting percentiles, quartiles and median
Worked example
Example 2.19: on a timed math test, the first quartile for the time it took to finish was 35 minutes. Interpret it. Try It 2.19 asks the same about the third quartile of 100-metre dash times, 11.5 seconds.
Name Q1 as a percentile
Why: the first quartile is the 25th percentile.
\[ Q_1 = P_{25} = 35 \text{ minutes} \]
State the share below
Why: a quarter of the data are at or below Q1.
\[ 25\% \text{ finished in } 35 \text{ minutes or less} \]
State the share above
Why: the other three quarters are at or above it.
\[ 75\% \text{ finished in } 35 \text{ minutes or more} \]
Figure (svg): Two horizontal bars split by a yellow cut. Top, test finishing times: the cut at Q1 = 35 minutes leaves a blue quarter on the left labelled 25 percent and an orange three-quarters on the right labelled 75 percent took 35 minutes or more. Bottom, 100-metre dash times: the cut at Q3 = 11.5 seconds leaves a blue three-quarters on the left labelled 75 percent ran 11.5 seconds or less and an orange quarter on the right. An arrow under each bar points left, labelled faster.
Judge good or bad from the context
Why: on a timed exam, finishing quickly is desirable, so a low percentile could be considered good.
\[ \text{low time} \;\Rightarrow\; \text{low percentile} \;\Rightarrow\; \text{good here} \]
Try It 2.19: the same four parts for Q3
Why: the third quartile is the 75th percentile.
\[ Q_3 = P_{75} = 11.5 \text{ s}: \quad 75\% \le 11.5 \text{ s}, \quad 25\% \ge 11.5 \text{ s} \]
In a race a low time is a fast time, so a runner at the 75th percentile of times is in the slower quarter, the opposite of the usual feeling that a high percentile is good.
Check that each sentence has all four parts
Why: context, value with units, percent below, percent above.
\[ \text{race times} \; \checkmark, \quad 11.5 \text{ s} \; \checkmark, \quad 75\% \; \checkmark, \quad 25\% \; \checkmark \]
In words: seventy-five percent of the runners finished the 100-metre dash in 11.5 seconds or less, and twenty-five percent took 11.5 seconds or more, so a time above 11.5 seconds is in the slowest quarter. The book prints no answer for the Try It; this is it.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 93 — Example 2.19 and Try It 2.19
Worked example
Four short interpretations follow in the book, and it prints a solution for none of them. Each answer needs the same four parts; here they are, one line of maths and one sentence each.
Example 2.20: the 70th percentile on a 20-question test is 16 correct
Why: 70 percent at or below, 30 percent at or above.
\[ P_{70} = 16: \quad 70\% \text{ got } 16 \text{ or fewer right}, \quad 30\% \text{ got } 16 \text{ or more} \]
A high percentile is good here, since more correct answers is better. And notice again that 16 of 20 is 80 percent correct, so the 70th percentile is not 70 percent correct.
Try It 2.20: the 80th percentile of points on a 60-point assignment is 49
Why: 80 percent at or below, 20 percent at or above.
\[ P_{80} = 49: \quad 80\% \text{ earned } 49 \text{ points or fewer}, \quad 20\% \text{ earned } 49 \text{ or more} \]
Example 2.21: the 30th percentile of credit units is 7
Why: 30 percent at or below, 70 percent at or above.
\[ P_{30} = 7: \quad 30\% \text{ take } 7 \text{ units or fewer}, \quad 70\% \text{ take } 7 \text{ or more} \]
This one carries no value judgement: taking few units is neither good nor bad, it describes students who study part-time. The book's point is that you should not invent a judgement the context does not support.
Check Try It 2.21 with all four parts
Why: the 40th percentile of points scored per player in a game is 8.
\[ P_{40} = 8: \quad 40\% \text{ scored } 8 \text{ points or fewer}, \quad 60\% \text{ scored } 8 \text{ or more} \]
Context, value with units, percent below and percent above are all there. Scoring more points is better for a player, so a high percentile is the good end, and a player scoring 8 is a little below the middle of this group.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 93 — Examples 2.20 and 2.21, Try Its 2.20 and 2.21
Worked example
A principal applying for a grant for gym equipment surveys 15 anonymous students on how many minutes a day they exercise. The book gives the five values; here they are computed from the data, then used to answer the principal's question.
Order the fifteen answers
Why: fifteen is odd: the median is place 8, and each half has seven values.
\[ 0,\ 0,\ 10,\ 20,\ 30,\ 30,\ 30,\ \boxed{40},\ 45,\ 60,\ 60,\ 60,\ 90,\ 120,\ 300 \]
Find the quartiles
Why: the middle, place 4, of each half of seven.
\[ Q_1 = 20, \quad \text{Med} = 40, \quad Q_3 = 60, \quad \text{Min} = 0, \quad \text{Max} = 300 \]
Find the IQR
Why: Q3 minus Q1.
\[ \text{IQR} = 60 - 20 = 40 \]
Find the upper fence
Why: the book checks the suspicious high value.
\[ Q_3 + 1.5(\text{IQR}) = 60 + 1.5(40) = 60 + 60 = 120 \]
Figure (svg): Two dot plots of exercise minutes on an axis from 0 to 320. Top, all fifteen students: a blue band from Q1 = 20 to Q3 = 60, a yellow tick at the median 40, a dashed red upper fence at 120, and one red dot at 300. Bottom, the fourteen students left after deleting 300: the same blue band, the median tick now at 35, and the largest dot at 120.
The book's reasoning: 75 percent of students exercise 60 minutes or less a day, and half exercise between 20 and 60 minutes. That seems a reasonable amount, so the principal would be justified in buying equipment. But the value 300 is far above the fence of 120.
Check every large value against the fence
Why: the rule flags values more than 120, not equal to it.
\[ 90 < 120, \qquad 120 = 120 \; (\text{not flagged}), \qquad 300 > 120 \]
So 300 minutes, five hours a day, is the one potential outlier. The 120 sits exactly on the fence and is not flagged, which is the detail the book's wording of the rule decides. Five hours of daily exercise might be a serious athlete, or a joke answer on an anonymous survey; it needs investigating.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, pp. 93-94 — Example 2.22
Worked example
The book recomputes the summary without the 300 to see whether the conclusion depends on it. It lists the minimum, quartiles and maximum but leaves out the median, which is the one value that changes, so it is supplied here.
Write the fourteen remaining values
Why: an even count now, so each half has seven.
\[ 0,\ 0,\ 10,\ 20,\ 30,\ 30,\ 30,\ 40,\ 45,\ 60,\ 60,\ 60,\ 90,\ 120 \]
Find the new median
Why: place 7.5: average the 7th and 8th values.
\[ \text{Med} = \dfrac{30 + 40}{2} = 35 \]
Find the new quartiles
Why: the 4th value of each half of seven.
\[ Q_1 = x_{(4)} = 20, \qquad Q_3 = x_{(11)} = 60 \]
Find the new extremes
Why: the 300 is gone.
\[ \text{Min} = 0, \qquad \text{Max} = 120 \]
The middle half has not moved at all: still 20 to 60 minutes. The median slid down by 5 minutes, because the middle of the list moved half a place left. The maximum fell from 300 to 120. Quartiles resist one extreme value; the maximum is that value.
Check the principal's conclusion
Why: with or without 300, three quarters exercise 60 minutes or less and half exercise between 20 and 60.
\[ \text{with: } [20, 60], \quad \text{without: } [20, 60] \;\checkmark \]
The conclusion does not depend on the outlier. But the book closes with a warning that matters more than any of the arithmetic: 15 students is a small sample, and the principal should survey more students to be sure of the results.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 94 — Example 2.22
Worked example
An instructor wants students to spend about 3 to 4 hours on a final project, and samples 10 students. Find the five values, then decide whether to modify the project.
\[ 2;\ 3;\ 5;\ 3;\ 4;\ 4;\ 3;\ 11;\ 3;\ 2 \text{ hours} \]
Order the ten answers
Why: ten is even, so each half has five values.
\[ 2,\ 2,\ 3,\ 3,\ 3,\ 3,\ 4,\ 4,\ 5,\ 11 \]
Find the median
Why: place 5.5: the 5th and 6th values are both 3.
\[ \text{Med} = \dfrac{3 + 3}{2} = 3 \]
Find the quartiles
Why: the middle, 3rd, value of each half.
\[ Q_1 = 3, \quad Q_3 = 4, \quad \text{Min} = 2, \quad \text{Max} = 11 \]
Find the IQR and fences
Why: Q3 minus Q1 is 1, and one and a half of it is 1.5.
\[ 3 - 1.5 = 1.5, \qquad 4 + 1.5 = 5.5 \]
Figure (svg): A dot plot of ten students' project hours on an axis from 0 to 12: 2 twice, 3 four times, 4 twice, 5 once and 11 once. A narrow blue band covers Q1 = 3 to Q3 = 4. Dashed red fences stand at 1.5 and 5.5, and the dot at 11 is red.
The middle half of students spent between 3 and 4 hours, exactly the instructor's target. The only value outside the fences is 11 hours, a potential outlier: a student who struggled, or one who went far beyond the brief, and worth a conversation either way.
Check the decision against the data
Why: count the students within the target range and the one outside the fences.
\[ \#(3 \le x \le 4) = 6, \qquad 2 < 1.5? \; \text{no}, \qquad 11 > 5.5 \; \text{yes} \]
Six of ten students were within the target and the typical time, 3 hours, is on target, so the instructor should leave the project as is and follow up with whoever spent 11 hours. The book prints no answer; this is one well-supported one.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 94 — Try It 2.22
Real world
Percentiles are everywhere outside the textbook: a child's height on a growth chart, a test result, an income bracket, a web page's load time. Practise the habits of this section on one you find yourself.
Discussion prompt
Find a percentile reported somewhere in public life. Write down the reference group it is computed against, the value that corresponds to it in its units, and an interpretation sentence with all four parts. Then say whether a high percentile is good, bad or neither in that context, and why.
Two traps are worth checking in whatever you found. First, is the percentile being read as a percent of something else, a percent correct or a percent of the maximum? Second, is the reference group named? A score at the 90th percentile of a gifted programme and of the general population are very different achievements.
One more thing to look for is whether the figure is a percentile at all. A story about the top 10 percent of earners is describing everyone above the 90th percentile of income, and the useful number to ask for is the value at that cut, in dollars.
The book's own example belongs here: a college that accepts SAT scores at or above the 75th percentile has turned a percentile into a cutoff value, 1220, and every applicant is compared with that value.
OpenStax Introductory Statistics 2e, §2.3 Measures of the Location of the Data §2.3, p. 86 — percentiles and SAT scores
Section
Part 7
Pattern
Every tool in this section works on places in the ordered list. Sort first; then let the question decide which tool to use.
Figure (svg): A flow chart. The top box asks what you were given. One arrow, labelled a percent, leads to a box reading index formula, i equals k over 100 times n plus 1, then the value at that place. A second arrow, labelled a value, leads to a box reading counting formula, x plus half y over n, then the percentile. A third arrow, labelled the whole data set, leads to a box reading quartiles, then IQR, then fences, then investigate.
Notice how few formulas there are. Two subtractions and a multiplication give the IQR and the fences; one multiplication gives the index; one division gives the percentile of a value. Everything else is ordering and counting places, which is where nearly every error in this section comes from.
The checks are the part that catches mistakes: a quartile should have about a quarter of the data on one side, a fence should be outside the box, and a percentile found by one formula should land close to where the other formula points.
Check
A small data set with an odd number of values. Decide what the lower half is before you look at the choices.
Check your understanding
Nine values are 3, 5, 6, 8, 9, 11, 12, 15 and 20. Using the book's method, what is the first quartile?
Answer: A
Why: The median of nine values is the fifth, 9, and it belongs to neither half. The lower half is 3, 5, 6 and 8, four values, so Q1 is the average of the middle pair, 5 and 6, which is 5.5.
The two wrong answers that come closest, 6 and 5, each come from a single mistake about the halves. Saying the convention out loud, median in neither half, prevents both.
The upper quartile follows the same way. The upper half is 11, 12, 15 and 20, so Q3 is the average of 12 and 15, which is 13.5, and the IQR is 13.5 minus 5.5, which is 8.
Check the answer by counting: two values, 3 and 5, are below 5.5, and a quarter of nine is 2.25. Two is the nearest whole count, so 5.5 is a fair first quartile.
Check
Four values and one pair of quartiles. Build both fences before judging any value.
Check your understanding
A data set has Q1 = 40 and Q3 = 70. Which of these values would the 1.5 IQR rule flag as a potential outlier?
Answer: A
Why: The IQR is 30, and one and a half of it is 45. The fences are 40 minus 45, which is minus 5, and 70 plus 45, which is 115. Only 116 lies beyond a fence, above 115.
\[ \text{IQR} = 70 - 40 = 30, \quad 1.5(30) = 45, \quad 40 - 45 = -5, \quad 70 + 45 = 115 \]
Notice that a negative value can sit inside the fences. The rule knows nothing about whether a negative value makes sense for the variable; that is a separate question, and an impossible value deserves investigation even when the fences accept it.
The distractors are chosen to sit just inside the fences. If you flagged one of them, you probably judged by eye, or measured from the median rather than from the quartiles.
Check
One reported percentile and four readings of it. Look for the one that compares one score with the other scores.
Check your understanding
On a 50-question quiz, a student's score is at the 85th percentile. Which statement must be true?
Answer: A
Why: A percentile ranks a value within its group. The 85th percentile means about 85 percent of the scores are the same as or less than this one, and about 15 percent the same as or greater. It says nothing directly about how many questions were answered correctly.
The two most tempting wrong answers are the same error in two forms. Whenever a percentile appears, ask: a percent of what? For a percentile, the answer is always a percent of the group, never a percent of the test.
Notice also that the 50 questions are a distraction. They matter for percent correct and for nothing else here: an 85th percentile would mean the same thing on a quiz of 10 questions or of 100.
A complete interpretation would add the context and the value: about 85 percent of the class scored at or below this student's score, and about 15 percent at or above it.
Explain it to yourself
One idea runs under Part 2. Putting it into your own words is what lets you use the outlier rule with judgement rather than by rote.
Discussion prompt
In three or four sentences, explain to someone who missed this lesson why the outlier fences are measured from Q1 and Q3 using the IQR, rather than from the median using the range. Then explain why a flagged value should be investigated rather than deleted. Use the house prices or the night class as your example.
If your explanation mentioned that the night class's two low scores were flagged while the day class's lowest score, 32, was not, you have the key point: the fences belong to each data set, set by its own middle half.
And if your explanation of investigating named a concrete check, such as looking up the original record or asking the person who reported it, it is a strong explanation. Investigate means do something specific, not merely be suspicious.
If you found it hard to explain why 1.5, that is honest: it is a convention. What matters is that the multiplier is fixed in advance, so everyone applying the rule to the same data flags the same values.
Exit ticket
One data set, the whole lesson. Answer in full sentences, naming the evidence for each answer.
Twelve commuters report their one-way commute in minutes: 5, 8, 10, 12, 12, 15, 18, 20, 22, 25, 30, 65.
Discussion prompt
Find the five-number summary and the IQR. Is any commute a potential outlier? Then find the percentile of 22 minutes and the 90th percentile, and interpret the 90th percentile in context.
Compare your summary with the picture it implies. Eleven commutes lie between 5 and 30 minutes, and one is 65. The quartiles and the median ignore how far out the 65 is; only the maximum and the 90th percentile feel it, which is exactly what you should expect from measures of location.
The most common slips: averaging the wrong pair for a quartile (with twelve values each half has six, so Q1 averages the third and fourth), and reporting the index 11.7 instead of the value 47.5. With only twelve values, the 90th percentile leans heavily on one commute, a reminder that extreme percentiles of small samples are fragile.
Recap
This section measured where a value stands. Each row of the table is one measure, how to find it, and the slip it invites.
| measure | how to find it | the trap |
|---|---|---|
| quartiles | order; median; then the median of each half, odd-count median in neither | skipping the sort; putting the median into a half |
| IQR | Q3 minus Q1: the width of the middle half | using the range, which extremes stretch |
| potential outliers | beyond Q1 minus 1.5 IQR or Q3 plus 1.5 IQR | fences from the median; deleting flagged values |
| percentile meaning | k percent of the data at or below the value | reading it as a percent correct |
| value at a percentile | i = (k/100)(n + 1); whole: read place i, else average | reporting i; rounding i instead of averaging |
| percentile of a value | (x + 0.5y)/n times 100, rounded | counting the value itself as fully below |
| interpretation | context, value with units, percent below, percent above | a value judgement the context does not support |
Underneath the table is one habit: put the data in order, then count places. Every number in this section, from the quartiles of fourteen values to the 90th percentile of fifty students' sleep, came from that habit.
And keep the two directions apart. A percent given asks for a value, found with the index formula; a value given asks for a percentile, found by counting. Both answers deserve a sentence that names the group, the value in its units, and the shares below and above.
Section 2.4 draws the five-number summary as a box plot, so the box from Q1 to Q3, the median line and the potential outliers you found here all become a single picture.
OpenStax Introductory Business Statistics 2e, §2.2 Measures of the Location of the Data §2.2 — measures of the location of the data, in business settings
Want this taught 1-on-1? Alexander tutors Statistics — $55/session, free consultation.