Educerie

Educerie · AP · Statistics

AP Statistics 1.7

Summary Statistics for One Quantitative Variable

How do we describe data about one variable, and how must the data be collected before we can trust what they say?

What you will learn

  • Understand how to find the mean, median, quartiles and percentiles of a data set
  • Know how to measure variability with the range, IQR and standard deviation
  • Understand the two outlier rules and why they can disagree
  • Know that the median and IQR are resistant and the mean, range and standard deviation are not

You must be able to

  1. Calculate the mean, median, quartiles, IQR and standard deviation, showing the formula
  2. Show whether a value is an outlier using the 1.5 IQR fences
  3. Apply the 2 standard deviation rule and compare it with the IQR rule
  4. Choose between the median and IQR or the mean and standard deviation, and say why
  5. State how a change of units changes each statistic

In the exam. Section I multiple choice, as a short calculation (a mean, a quartile, an outlier fence, a percentile) or a question on which statistic is unchanged by an outlier. In Section II, the data-analysis question asks you to find outliers by the 1.5 times IQR rule and to justify the measure of center or variability you use. The calculation is worth marks only when the work is shown.

1The data used in this note

A student records the number of text messages sent in one day by 12 classmates. Sorted from smallest to largest:

12, 15, 18, 20, 22, 25, 27, 30, 34, 38, 45, 90

Here n=12n = 12. The calculations below are worked by hand so you can see the method. On the exam you may use technology for the mean, the median and the standard deviation, and you should still know what each is.

2Measures of center

Mean = the sum of the values divided by the number of values. For a sample it is written xˉ\bar{x}.

xˉ=1n∑i=1nxithe sample mean, as on the reference sheet=37612≈31.3the 12 values add to 376\begin{aligned}\bar{x} &= \frac{1}{n}\sum_{i=1}^{n} x_i && \textcolor{#838c91}{\text{the sample mean, as on the reference sheet}} \\[6pt] &= \frac{376}{12} \approx 31.3 && \textcolor{#838c91}{\text{the 12 values add to 376}}\end{aligned}

Median = the middle value of the ordered data. With an even number of values, take the mean of the two middle values.

Here the two middle values (the 6th and 7th) are 25 and 27, so the median is 25+272=26\frac{25 + 27}{2} = 26. With an odd number of values, use the one in the middle.

The mean is about 31.3 messages and the median is 26. They differ because of the 90, which pulls the mean up.

3Quartiles, percentiles, minimum and maximum

The minimum is the smallest value (12) and the maximum is the largest (90).

The first quartile, Q1Q_1, is the median of the lower half of the ordered data. The third quartile, Q3Q_3, is the median of the upper half. The median is Q2Q_2. About 25% of the values are at or below Q1Q_1, and about 75% are at or below Q3Q_3. The quartiles mark the boundaries of the middle 50% of the data.

  • Lower half (6 values): 12, 15, 18, 20, 22, 25. The middle two are 18 and 20, so Q1=19Q_1 = 19.
  • Upper half (6 values): 27, 30, 34, 38, 45, 90. The middle two are 34 and 38, so Q3=36Q_3 = 36.

The course description takes each half from the end of the data to the position of the median. With an odd number of values, the median therefore belongs to both halves. Calculators and books can differ a little here, so use one method consistently and show your work. The data in this note have an even nn, where the halves are clear.

Percentile = the ppth percentile is the value with pp% of the data less than or equal to it. The first and third quartiles are the 25th and 75th percentiles.

Example: 10 of the 12 values are 38 or less, so 38 is at about the 1012≈83\frac{10}{12} \approx 83rd percentile. Say it in context: "about 83% of the 12 students sent 38 or fewer texts."

4Measures of variability

Range = maximum minus minimum.

range=90−12=78a single number\text{range} = 90 - 12 = 78 \qquad \textcolor{#838c91}{\text{a single number}}

Interquartile range (IQR) = the difference between the third and first quartiles. It is the width of the middle half of the data.

IQR=Q3−Q1=36−19=17messages\text{IQR} = Q_3 - Q_1 = 36 - 19 = 17 \qquad \textcolor{#838c91}{\text{messages}}

Standard deviation = a typical deviation of the data values from their mean. For a sample it is written ss.

s=1n−1∑i=1n(xi−xˉ)2the sample standard deviation, as on the reference sheets = \sqrt{\frac{1}{n - 1}\sum_{i=1}^{n} (x_i - \bar{x})^2} \qquad \textcolor{#838c91}{\text{the sample standard deviation, as on the reference sheet}}

Work it in steps. Subtract the mean from each value, square, add, divide by n−1=11n - 1 = 11 and take the square root.

xix_ixi−xˉx_i - \bar{x}(xi−xˉ)2(x_i - \bar{x})^2
12−19.33-19.33373.78
15−16.33-16.33266.78
18−13.33-13.33177.78
20−11.33-11.33128.44
22−9.33-9.3387.11
25−6.33-6.3340.11
27−4.33-4.3318.78
30−1.33-1.331.78
342.677.11
386.6744.44
4513.67186.78
9058.673441.78
Sum04774.67
s=4774.6711=434.06≈20.8messagess = \sqrt{\frac{4774.67}{11}} = \sqrt{434.06} \approx 20.8 \qquad \textcolor{#838c91}{\text{messages}}

The squared deviations add to 4774.67, and the deviations themselves add to 0 (a useful check). The square of the standard deviation, s2≈434.1s^2 \approx 434.1, is the sample variance.

The standard deviation is about 20.8 messages. Most of that comes from the 90, whose squared deviation (3441.78) is more than all the other eleven added together.

On the exam, a calculator gives xˉ\bar{x} and ss in its one-variable statistics screen. Write the formula and the values you read from it, because a bare number is not enough work.

5Outliers: two rules

There are many ways to flag outliers. Two are used often.

The 1.5 times IQR rule. A value is an outlier if it is more than 1.5 IQR above Q3Q_3 or more than 1.5 IQR below Q1Q_1.

1.5×IQR=1.5×17=25.5the allowed distance beyond a quartile1.5 \times \text{IQR} = 1.5 \times 17 = 25.5 \qquad \textcolor{#838c91}{\text{the allowed distance beyond a quartile}}Q1−25.5=19−25.5=−6.5the lower fenceQ_1 - 25.5 = 19 - 25.5 = -6.5 \qquad \textcolor{#838c91}{\text{the lower fence}}Q3+25.5=36+25.5=61.5the upper fenceQ_3 + 25.5 = 36 + 25.5 = 61.5 \qquad \textcolor{#838c91}{\text{the upper fence}}

No value is below −6.5-6.5. The value 90 is above 61.5. So 90 is an outlier by this rule, and no other value is.

The 2 standard deviation rule. A value is an outlier if it is more than 2 standard deviations above or below the mean.

xˉ±2s=31.3±2(20.8)=31.3±41.7the interval (−10.4, 73.0)\bar{x} \pm 2s = 31.3 \pm 2(20.8) = 31.3 \pm 41.7 \qquad \textcolor{#838c91}{\text{the interval (−10.4, 73.0)}}

The value 90 lies above 73.0, so it is an outlier here too.

The two rules do not always agree. Take the clinic waiting times (Topic 1.5), where xˉ≈18.27\bar{x} \approx 18.27, s≈12.83s \approx 12.83, Q1=9Q_1 = 9, Q3=24Q_3 = 24:

RuleFence or limitValues flagged
1.5 IQRupper fence 24+1.5(15)=46.524 + 1.5(15) = 46.558
2 standard deviationsupper limit 18.27+2(12.83)=43.918.27 + 2(12.83) = 43.945 and 58

The rule is a convention, not a law. State which rule you used and show the calculation. When a question says "show that", you need the fence, the value and the comparison.

6Resistant and non-resistant statistics

A statistic is resistant if outliers do not greatly, if at all, affect its value.

  • Resistant: the median and the IQR.
  • Not resistant: the mean, the range and the standard deviation.

Test it. Replace the 90 with 40, so the largest value becomes 45. Figure 1 compares the two data sets.

Figure 1. Texts sent in a day by 12 students, with and without an extreme value: the median (solid line) stays at 26 in both, while the mean (dashed line) falls from 31.3 to 27.2 when the 90 is replaced by 40 With the value 90 20 40 60 80 100 0 Texts sent in a day median 26 mean 31.3 Figure 1. Texts sent in a day by 12 students, with and without an extreme value: the median (solid line) stays at 26 in both, while the mean (dashed line) falls from 31.3 to 27.2 when the 90 is replaced by 40 With 40 in its place 20 40 60 80 100 0 Texts sent in a day median 26 mean 27.2
Figure 1 · Texts sent in a day by 12 students, with and without an extreme value: the median (solid line) stays at 26 in both, while the mean (dashed line) falls from 31.3 to 27.2 when the 90 is replaced by 40
StatisticWith 90With 40 in its place
Mean31.327.2
Median2626
IQR1717
Range7833
Standard deviation20.810.4

The median and IQR did not move. The mean, the range and the standard deviation changed a lot. That is what "resistant" means in practice.

7Choosing a statistic

Justifying the choice of a summary is a regular part of the free-response questions.

  • Skewed, or with outliers: use the median for center and the IQR for variability. Outliers do not distort them.
  • Approximately symmetric with no outliers: the mean and standard deviation are good choices, because they use every value.

Example (invented): two classes of 20 students recorded their daily homework time in minutes. Class A has median 59, IQR 16, mean 58.7 and standard deviation 11.6. Class B has median 45, IQR 29, mean 52.1 and standard deviation 26.9, and its largest value, 130, is an outlier.

For Class B, the mean (52.1) is above the median (45) because the outlier pulls it up. A fair statement about a typical student in Class B uses the median, 45 minutes. Say it: "Because Class B has an outlier, the median is the better measure of center, since it is not affected by the 130."

The data in this example are shown in Topic 1.9.

8Changing units

Changing the units of measurement changes the calculated statistics. If you convert every value from one unit to another by multiplying by a number, each measure of center or position, and each measure of variability, is multiplied by that same number.

Example: the clinic waiting times in minutes become hours when divided by 60.

StatisticIn minutesIn hours (divide by 60)
Median14.50.242
Mean18.270.304
IQR150.25
Standard deviation12.830.214
Range540.9

A conversion that also adds a number, such as temperature from degrees Celsius to degrees Fahrenheit, multiplies and then adds. Measures of center and position follow both steps. Measures of variability (range, IQR, standard deviation) are changed only by the multiplication.

Always give the unit with a statistic. "The median is 14.5 minutes" and "0.242 hours" are the same fact.

Practice questions

30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.