Tutorials › AP Statistics › How Outliers Change Mean, Median, and Standard Deviation

Summary statistics · Tutorial 117 of 1000

How Outliers Change Mean, Median, and Standard Deviation

Learn to recalculate and compare the mean, median, and sample standard deviation when a high outlier is added to a sample.

Beginner 9 min read

What You'll Learn

  • Use the sample size and mean to calculate how adding one observation changes the mean.
  • Recalculate the median after inserting a high value into the ordered data.
  • Compare sample standard deviations before and after adding a high outlier.
  • Use the sum-of-squares formula to calculate sample standard deviation efficiently.
  • Explain why a median may change little even when the mean and standard deviation change substantially.
  • Write comparisons in context, with units and appropriate rounding.

Adding a High Value to a Sample

In Effect of Removing an Outlier, you compared summaries after taking an unusual observation out of a sample. Now consider the reverse: what happens to the mean, median, and sample standard deviation when one high value is added? The mean and standard deviation respond to the numerical size of every observation, while the median depends on the ordered positions of the observations.

A high value is not automatically an error. As discussed in What Outliers Mean in Context, a value that stands apart should be investigated in context. Here, assume the added observation is a valid measurement and compare the summaries with and without it. Keep the original observations; the new sample has one more observation.

Key idea: Adding a high outlier generally pulls the mean upward and increases the sample standard deviation, sometimes substantially. The median is more resistant, but it may shift depending on the original sample size and the positions of the middle observations.

Why the Summaries Respond Differently

Suppose a sample has \(n\) observations and mean \(\bar{x}\), and a new observation \(y\) is added. The original sum is \(n\bar{x}\), so the new sum is \(n\bar{x}+y\). There are now \(n+1\) observations. This gives a useful way to calculate the new mean and the amount it changes.

$$ \text{new mean}=\frac{n\bar{x}+y}{n+1} \qquad\text{and}\qquad \text{change in mean}=\frac{y-\bar{x}}{n+1} $$

If \(y\) is above the original mean, the new mean rises. Its increase depends both on how far \(y\) is above the original mean and on the sample size: the same added value usually has a smaller effect on the mean of a larger sample. The new mean does not jump all the way to \(y\); it is an average of all \(n+1\) values.

To find the new median, insert the added value into the ordered data and locate the middle position or positions again. Do not assume the median stays fixed simply because it is resistant. Depending on whether the original sample size was odd or even, adding one value changes which position or pair of positions determines the median.

The sample standard deviation \(s\) describes a typical distance from the sample mean. Adding a high value can increase the spread, and the new mean also changes the deviations of the original observations. Recalculate \(s\) using the new mean and the new sample size; do not just add the distance of the outlier to the old standard deviation.

Formula: If \(T=\sum x\) is the sum of the observations and \(Q=\sum x^2\) is the sum of their squares, the sample variance and sample standard deviation can be calculated as follows. Use the new values of \(T\), \(Q\), and \(n\) after adding the observation.
$$ s^2=\frac{Q-\frac{T^2}{n}}{n-1} \qquad\text{and}\qquad s=\sqrt{s^2} $$

This is a computational form of the sample standard deviation formula introduced in Calculating Standard Deviation by Hand. It gives the same result as finding each deviation from the mean, squaring the deviations, and dividing their sum by \(n-1\). The units of \(s\) are the same as the data values.

A Reliable Comparison Method

For each comparison, calculate the original summaries and the summaries for the enlarged sample. Include the added value when finding the new mean and standard deviation. For the median, order all the values and identify the new middle position or positions. Then report how the summaries changed, using the measurement’s units.

1
Record the original sample.
Find its sample size, mean, median, and sample standard deviation.
2
Add and order the new value.
Include the high observation, increase the sample size by one, and identify the middle position or positions for the new median.
3
Recalculate the mean and standard deviation.
Use all observations in the enlarged sample. For \(s\), the denominator is now the new sample size minus one.
4
Compare in context.
Describe the direction and size of each change, with units. Do not claim that the median must stay the same.

Worked Examples: Comparing Before and After

Worked Example: A High Wait Time Joins a Small Sample

A fictional sample of five customer wait times, in minutes, is \(8, 9, 10, 11, 12\). A sixth customer has a wait time of 50 minutes. Compare the sample mean, median, and sample standard deviation before and after adding that wait.

Original sample. The sum is \(8+9+10+11+12=50\), so the original mean is \(50/5=10\) minutes. The middle observation is 10, so the original median is 10 minutes. The deviations from the mean are \(-2,-1,0,1,2\). Their squared sum is \(4+1+0+1+4=10\), so the original sample standard deviation is

$$ s=\sqrt{\frac{10}{5-1}}=\sqrt{2.5}\approx1.5811\text{ minutes} $$

New mean. Adding 50 gives a sum of \(50+50=100\) and a sample size of 6. Thus the new mean is \(100/6\approx16.6667\) minutes. The mean-change formula confirms the increase: \((50-10)/(5+1)=40/6\approx6.6667\) minutes.

New median. The ordered data are \(8,9,10,11,12,50\). With six observations, the median is the average of the third and fourth values: \((10+11)/2=10.5\) minutes.

New standard deviation. The sum of the squared observations is \(64+81+100+121+144+2500=3010\). Using \(T=100\) and \(n=6\),

$$ s^2=\frac{3010-\frac{100^2}{6}}{6-1} =\frac{1343.3333\ldots}{5} \approx268.6667 \qquad s=\sqrt{268.6667}\approx16.39\text{ minutes} $$

As a check, the new mean is about \(16.6667\). The squared deviations from it sum to about \(1343.3333\); dividing by \(5\) gives the same variance, about \(268.6667\), and taking the square root gives about \(16.39\) minutes.

Conclusion in context. Adding the 50-minute wait raises the sample mean from 10 to about 16.67 minutes and the median from 10 to 10.5 minutes. The sample standard deviation rises from about 1.58 to 16.39 minutes. The single high wait has a much larger effect on the mean and standard deviation than on the median.

Worked Example: The Median Stays the Same

A fictional sample of six equipment repair times, in hours, is \(2,4,6,6,8,10\). A repair takes 100 hours. Compare the three summaries before and after including that high value.

Original sample. The sum is \(36\), so the mean is \(36/6=6\) hours. The median is the average of the third and fourth values, \((6+6)/2=6\) hours. The squared deviations from 6 sum to \(16+4+0+0+4+16=40\). Therefore,

$$ s=\sqrt{\frac{40}{6-1}}=\sqrt{8}\approx2.8284\text{ hours} $$

New mean and median. With 100 included, the sum is \(136\), and the sample size is 7. The new mean is \(136/7\approx19.4286\) hours. Equivalently, the mean increases by \((100-6)/(6+1)=94/7\approx13.4286\) hours. The ordered data are \(2,4,6,6,8,10,100\). The fourth value is the median, so the new median is still 6 hours.

New standard deviation. The sum of squared observations is \(4+16+36+36+64+100+10000=10256\). With \(T=136\) and \(n=7\),

$$ s^2=\frac{10256-\frac{136^2}{7}}{7-1} =\frac{7613.7143\ldots}{6} \approx1268.9524 \qquad s=\sqrt{1268.9524}\approx35.6224\text{ hours} $$

A check using deviations gives the same result: the squared deviations from the new mean sum to about \(7613.7143\), and dividing by \(6\) gives a variance of about \(1268.9524\). The square root is about \(35.6224\) hours.

Conclusion in context. Including the 100-hour repair raises the mean from 6 to about 19.43 hours and the sample standard deviation from about 2.83 to 35.62 hours. The median remains 6 hours because the fourth observation is 6 both before and after the addition. This example shows why “the median is resistant” does not mean “the median never changes”; here, its central position happens to retain the same value.

Worked Example: A High Seedling Measurement

A fictional sample of four seedling heights, in centimeters, is \(5,7,9,11\). Add a seedling measuring 30 centimeters and compare the mean, median, and sample standard deviation.

Original sample. The sum is \(32\), giving a mean of \(32/4=8\) centimeters. The median is \((7+9)/2=8\) centimeters. The squared deviations from 8 sum to \(9+1+1+9=20\), so the sample standard deviation is

$$ s=\sqrt{\frac{20}{4-1}}=\sqrt{\frac{20}{3}}\approx2.5820\text{ cm} $$

New mean and median. The new sum is \(32+30=62\), and the sample size is 5. The new mean is \(62/5=12.4\) centimeters. The mean-change formula gives \((30-8)/(4+1)=22/5=4.4\) centimeters, and \(8+4.4=12.4\). The ordered data are \(5,7,9,11,30\), so the new median is the third value, 9 centimeters.

New standard deviation. The squared observations sum to \(25+49+81+121+900=1176\). Thus,

$$ s^2=\frac{1176-\frac{62^2}{5}}{5-1} =\frac{407.2}{4} =101.8 \qquad s=\sqrt{101.8}\approx10.0896\text{ cm} $$

The calculation can also be checked from deviations: the new mean is 12.4, and the squared deviations sum to \(101.8(4)=407.2\). Dividing by the sample degrees of freedom, \(5-1=4\), gives the same variance of \(101.8\) square centimeters; its square root is about 10.0896 centimeters.

Conclusion in context. Adding the 30-centimeter seedling raises the sample mean from 8 to 12.4 centimeters, moves the median from 8 to 9 centimeters, and raises the sample standard deviation from about 2.58 to 10.09 centimeters. The comparison uses the same units for the heights, means, medians, and standard deviations.

Common Mistakes and AP Exam Tips

  • Assuming the median is unchanged. Resistance means a statistic is not greatly affected by extreme observations, not that it cannot change. Reorder the enlarged sample and locate its middle value or pair of values.
  • Keeping the old sample size in a calculation. After adding one observation, the new sample size is \(n+1\). The sample standard deviation denominator is the new sample size minus one, which is \(n\).
  • Adding the outlier’s distance to the old standard deviation. Standard deviation is not updated by adding distances directly. Recalculate deviations from the new mean, or use the sum-of-squares formula with all the new observations.
  • Mixing up sample standard deviation and variance. Variance is in squared units; standard deviation is its square root and is in the original units. For example, variance in square hours produces standard deviation in hours.
  • Calling an unusual value an error without evidence. A high value may be a valid observation. Describe its effect on the summaries, and investigate its source before deciding whether it should be corrected or excluded.
  • Giving only a vague comparison. “The spread got bigger” is incomplete when the question asks for summary values. Report the before-and-after values and units, then explain the direction and size of the change.

For a full-credit comparison, show the calculations with the enlarged sample, identify the median’s new middle position or positions, and interpret the changes in context. A clear conclusion might say: “Including the 100-hour repair raises the sample mean and standard deviation substantially, while the median remains 6 hours in this sample.”

Key takeaway: Adding a high outlier generally raises the mean and can greatly increase the sample standard deviation because both respond to numerical distances. The median depends on ordered positions, so recalculate it rather than assuming it stays fixed. Compare all three summaries using the enlarged sample and report their units.

Check Your Understanding

For each question, compare the summaries before and after adding the high value. Use the same measurement units throughout.

  1. A sample is \(3,5,7,9,11\). Find its mean and median. After adding 31, find the new mean and median. What changes?
  2. A sample has size \(n=8\) and mean \(\bar{x}=12\). A value of 30 is added. Use the mean-change formula to find the increase in the mean.
  3. Why must you locate the middle position or positions again when you recalculate a median after adding an observation?
  4. A sample has sum \(T=24\), sum of squares \(Q=146\), and size \(n=4\). Use the computational formula to find its sample standard deviation. Then explain which values must be updated if a new observation is added.
  5. Explain why adding one very high valid observation may change the mean and standard deviation much more than the median.