Unit 5, lesson 34

Standard Deviation and Changing Scale

How the standard deviation returns spread to the original units, how it differs from the mean absolute deviation, and how shifts, changes of scale and affine transformations change the mean, variance and standard deviation.

  • Video 34
  • Variance and Standard Deviation

A waiting time measured in minutes has a variance measured in square minutes, which is awkward to set beside an actual wait. Taking a square root brings the spread back to minutes. What happens to the mean and to that spread if every wait gets five extra minutes, or if the times are recorded in seconds instead? This lesson defines the standard deviation, compares it with the mean absolute deviation, and derives exact rules for the variable aX+baX + b when aa and bb are constants.

Key terms

Standard deviation

Definition Let XX be a random variable with a finite second moment E[X2]E[X^2], so that its mean μ=E[X]\mu = E[X] and its variance are finite. The standard deviation of XX is the nonnegative square root of its variance,

SD⁡(X)=Var⁡(X)=E[(X−μ)2].\begin{aligned} \operatorname{SD}(X) &= \sqrt{\operatorname{Var}(X)} \\[0.4em] &= \sqrt{E\big[(X - \mu)^2\big]} . \end{aligned}

It is often written σ\sigma. It is also called the root-mean-square deviation, a name that lists the operations from the outside in. The computation runs the other way. Take each deviation X−μX - \mu, square it, average the squares with the probability weights, and then take the root. The standard deviation has the same units as XX, and it equals 00 exactly when P(X=μ)=1P(X = \mu) = 1.

In plain words Variance measures spread in squared units, and the square root brings it back to the units of XX. The standard deviation is a single summary of how far XX tends to fall from its mean, in which larger deviations count more because they are squared before averaging. It does not determine the whole distribution, and on its own it does not say how much probability lies within one standard deviation of the mean.

Example Let XX be a constructed waiting time in minutes that equals 00, 22 or 44 with probabilities 14\tfrac14, 12\tfrac12 and 14\tfrac14. Its mean is 22 minutes, its deviations from the mean are −2-2, 00 and 22 minutes, and the probability-weighted average of their squares is 14⋅4+12⋅0+14⋅4=2\tfrac14 \cdot 4 + \tfrac12 \cdot 0 + \tfrac14 \cdot 4 = 2. So Var⁡(X)=2\operatorname{Var}(X) = 2 square minutes, and the standard deviation is SD⁡(X)=2≈1.414\operatorname{SD}(X) = \sqrt{2} \approx 1.414 minutes. Both 2\sqrt{2} and −2-\sqrt{2} solve s2=2s^2 = 2, and the definition takes the nonnegative one.

Mean absolute deviation

Definition For a random variable XX with finite mean μ\mu, the mean absolute deviation is the probability-weighted average distance from the mean,

E[∣X−μ∣].E\big[\lvert X - \mu \rvert\big].

On this page it is always measured from the mean. When XX also has finite variance,

E[∣X−μ∣]≤SD⁡(X),E\big[\lvert X - \mu \rvert\big] \le \operatorname{SD}(X),

because ∣X−μ∣2=(X−μ)2\lvert X - \mu \rvert^2 = (X - \mu)^2 gives 0≤Var⁡(∣X−μ∣)=Var⁡(X)−(E[∣X−μ∣])20 \le \operatorname{Var}(\lvert X - \mu \rvert) = \operatorname{Var}(X) - \big(E[\lvert X - \mu \rvert]\big)^2. Equality holds exactly when ∣X−μ∣\lvert X - \mu \rvert is constant with probability 11, that is, when P(X=μ)=1P(X = \mu) = 1 or when XX equals μ−c\mu - c and μ+c\mu + c with probability 12\tfrac12 each for some c>0c > 0.

In plain words Both numbers describe spread in the units of XX, but they are different measures. The mean absolute deviation averages the distances themselves, while the standard deviation averages the squared distances and then takes a root, which gives large deviations more weight. A number computed one way should not be reported under the other name.

Example For the waiting time XX, the distances from the mean are 22, 00 and 22 minutes, so the mean absolute deviation is 14⋅2+12⋅0+14⋅2=1\tfrac14 \cdot 2 + \tfrac12 \cdot 0 + \tfrac14 \cdot 2 = 1 minute, less than SD⁡(X)≈1.414\operatorname{SD}(X) \approx 1.414 minutes. Now let VV equal 2−22 - \sqrt{2} or 2+22 + \sqrt{2} minutes with probability 12\tfrac12 each. It has mean 22 and variance (2)2=2(\sqrt{2})^2 = 2, the same mean and standard deviation as XX. Yet VV never equals 22, while XX equals 22 with probability 12\tfrac12, and the mean absolute deviation of VV is 2\sqrt{2}, the equality case. Two distributions with the same mean and standard deviation can still be different distributions.

Shift

Definition Let XX have finite mean and let bb be a constant. The shifted variable X+bX + b adds bb to every value of XX and keeps every probability. Linearity gives E[X+b]=E[X]+bE[X + b] = E[X] + b, so the deviations do not change,

(X+b)−E[X+b]=X−E[X].\begin{aligned} &(X + b) - E[X + b] \\[0.4em] &\quad = X - E[X]. \end{aligned}

If XX has finite variance, it follows that

Var⁡(X+b)=Var⁡(X),SD⁡(X+b)=SD⁡(X).\begin{gathered} \operatorname{Var}(X + b) = \operatorname{Var}(X), \\[0.4em] \operatorname{SD}(X + b) = \operatorname{SD}(X). \end{gathered}

In plain words Adding the same amount to every outcome slides the whole distribution, and its mean, by that amount. Each distance from the new mean equals the old distance from the old mean, so the spread stays the same. Adding bb to the standard deviation as well is a common mistake.

Example Add a fixed preparation time of 55 minutes to every wait and let Y=X+5Y = X + 5. The values become 55, 77 and 99 minutes with the same probabilities, and the mean becomes 77 minutes. The deviations from 77 are −2-2, 00 and 22 minutes, exactly as before, so Var⁡(Y)=2\operatorname{Var}(Y) = 2 square minutes and SD⁡(Y)=2\operatorname{SD}(Y) = \sqrt{2} minutes.

Change of scale and change of units

Definition Let XX have finite variance and let aa be a constant. A change of scale multiplies XX by aa. Every deviation is multiplied by aa, since aX−E[aX]=a(X−E[X])aX - E[aX] = a\big(X - E[X]\big), and every squared deviation by a2a^2. Hence

E[aX]=a E[X],Var⁡(aX)=a2Var⁡(X),SD⁡(aX)=∣a∣SD⁡(X).\begin{gathered} E[aX] = a\,E[X], \\[0.4em] \operatorname{Var}(aX) = a^2 \operatorname{Var}(X), \\[0.4em] \operatorname{SD}(aX) = \lvert a \rvert \operatorname{SD}(X). \end{gathered}

A change of units writes the same quantity on another scale. Often it multiplies by a positive conversion factor, such as a=60a = 60 from minutes to seconds, which is a change of scale. Some changes of units also add a constant, as in the conversion from degrees Celsius to degrees Fahrenheit, and those are affine transformations, described in the next card.

In plain words Doubling every value doubles every distance from the mean, so the standard deviation doubles and the variance, which is in squared units, becomes four times as large. A standard deviation is a number together with a unit. A change of units can make that number larger without the process becoming any less consistent, so spreads should be compared only on a common scale.

Example Record the waiting time in seconds as 60X60X. The values become 00, 120120 and 240240 seconds, and the mean becomes 120120 seconds. The variance is 602⋅2=720060^2 \cdot 2 = 7200 square seconds, and the standard deviation is SD⁡(60X)=602≈84.85\operatorname{SD}(60X) = 60\sqrt{2} \approx 84.85 seconds, the same physical spread as 2≈1.414\sqrt{2} \approx 1.414 minutes. The variance grew by the factor 36003600, while the standard deviation grew by the factor 6060.

Affine transformation

Definition An affine transformation of a random variable XX is a random variable aX+baX + b for constants aa and bb, a change of scale followed by a shift. If XX has finite variance, then

E[aX+b]=a E[X]+b,Var⁡(aX+b)=a2Var⁡(X),SD⁡(aX+b)=∣a∣SD⁡(X).\begin{gathered} E[aX + b] = a\,E[X] + b, \\[0.4em] \operatorname{Var}(aX + b) = a^2 \operatorname{Var}(X), \\[0.4em] \operatorname{SD}(aX + b) = \lvert a \rvert \operatorname{SD}(X). \end{gathered}

The reason is that the shift cancels from the deviation, (aX+b)−E[aX+b]=a(X−E[X])(aX + b) - E[aX + b] = a\big(X - E[X]\big). Squaring and taking expectations gives the variance, and the nonnegative square root of a2a^2 is ∣a∣\lvert a \rvert. When a=0a = 0, the variable is the constant bb and its variance and standard deviation are both 00. When a<0a < 0, the order of the values is reversed, but the spread is not negative.

In plain words The shift bb moves the center and drops out of every distance from the center. The factor aa multiplies every distance from the center by ∣a∣\lvert a \rvert, and a negative factor also mirrors the distribution. So the new standard deviation depends on the old one and on ∣a∣\lvert a \rvert, and not on bb.

Example Define the score Z=10−2XZ = 10 - 2X, so a=−2a = -2 and b=10b = 10. The rules give E[Z]=10−2⋅2=6E[Z] = 10 - 2 \cdot 2 = 6, Var⁡(Z)=(−2)2⋅2=8\operatorname{Var}(Z) = (-2)^2 \cdot 2 = 8 and SD⁡(Z)=22=8≈2.83\operatorname{SD}(Z) = 2\sqrt{2} = \sqrt{8} \approx 2.83 score units. A direct check agrees. The values 00, 22 and 44 go to 1010, 66 and 22, the deviations from 66 are 44, 00 and −4-4, and 14⋅16+12⋅0+14⋅16=8\tfrac14 \cdot 16 + \tfrac12 \cdot 0 + \tfrac14 \cdot 16 = 8. The order of the outcomes is reversed, yet the standard deviation is positive.

Check yourself

  1. A score WW equals 11 or 33 with probability 12\tfrac12 each, and R=4−3WR = 4 - 3W. Find the mean, variance and standard deviation of RR, and check them by listing the values of RR.
Show the answer

The score WW has mean 22, deviations −1-1 and 11, variance 11 and standard deviation 11. With a=−3a = -3 and b=4b = 4, the affine rules give E[R]=4−3⋅2=−2E[R] = 4 - 3 \cdot 2 = -2, Var⁡(R)=(−3)2⋅1=9\operatorname{Var}(R) = (-3)^2 \cdot 1 = 9 and SD⁡(R)=∣−3∣⋅1=3\operatorname{SD}(R) = \lvert -3 \rvert \cdot 1 = 3. Directly, RR equals 11 or −5-5 with probability 12\tfrac12 each. Both values lie 33 units from −2-2, which confirms the variance 99 and the standard deviation 33. The negative factor swaps which value is larger, but distances from the mean stay nonnegative, so the spread is positive.

  1. A random temperature TT in degrees Celsius has mean 2020 and standard deviation 33. The same temperature in degrees Fahrenheit is Y=95T+32Y = \tfrac95 T + 32. Find the mean, standard deviation and variance of YY. Someone reports the standard deviation in degrees Fahrenheit as 95⋅3+32=37.4\tfrac95 \cdot 3 + 32 = 37.4. What went wrong?
Show the answer

This is an affine change of units with a=95a = \tfrac95 and b=32b = 32. The mean is 95⋅20+32=68\tfrac95 \cdot 20 + 32 = 68 degrees Fahrenheit, the standard deviation is 95⋅3=5.4\tfrac95 \cdot 3 = 5.4 degrees Fahrenheit, and the variance is (95)2⋅9=29.16\big(\tfrac95\big)^2 \cdot 9 = 29.16 square degrees Fahrenheit. The added 3232 moves the zero point of the scale, so it changes the mean but cancels from every deviation. Adding it to the standard deviation is the mistake.

  1. Let XX equal 00 with probability 0.90.9 and 1010 with probability 0.10.1. Find its mean and standard deviation, and the probability that XX lies within one standard deviation of its mean. Is that probability close to 68 percent?
Show the answer

The mean is 10⋅0.1=110 \cdot 0.1 = 1, and E[X2]=100⋅0.1=10E[X^2] = 100 \cdot 0.1 = 10, so Var⁡(X)=10−12=9\operatorname{Var}(X) = 10 - 1^2 = 9 and SD⁡(X)=3\operatorname{SD}(X) = 3. The interval from 1−3=−21 - 3 = -2 to 1+3=41 + 3 = 4 contains the value 00 but not the value 1010, so the probability is 0.90.9, or 90 percent, and the answer is no. The figure of about 68 percent belongs to normal distributions and is not a property of standard deviations in general. How much probability lies within one standard deviation of the mean depends on the whole distribution.

How this lesson connects

Builds on