Ā

Statistically speaking, standard deviation is just a measure of dispersion or spread in a distribution. For example, the mean score in your classās chemistry final might be an 85 with a range of say 30 to 95. The

*range*is a measure of dispersion.Ā

Standard deviation is just another way to measure spread.

Ā

## To compute a standard deviation

- Compute the difference of each score from the mean

- Square the difference

- Sum these squared differences

- Find the mean of the squared differences by dividing by the number of observations ā> this is the
*variance*

- Take the square root of variance to find the
*standard deviation*

Ā

*Standard deviation is useful because we can map it to a bell curve and standardize any specific result. Z-scores normalize how far in units of standard deviation a result is from the mean. This tells us how likely it is to occur or how unusual it is if the data conforms to a Gaussian distribution.*

Ā

**The key point is that in the process of finding the standard deviation, we**

**squared**

**the differences. This will give outliers a higher weight in the computation of variance.**Ā

**Letās consider an example**

Ā

If 49 students score an 85 on a test and 1 scores a zero we see:

mean = 83.3

standard deviation = 11.9

Computations

## Mean

(49 x 85) + (1 x 0) = 4165

4165/50 =

**83.3**Ā

The class mean is

**83.3**## Standard deviation using the recipe above?

Ā

- Difference of each score from the mean:
- 49 students scored 1.7 points from the mean (they scored an 85 vs a mean of 83.3)
- 1 student scored 83.3 points away from the mean

Ā

- Square the differences
- 49 students each had a squared difference of 1.7Ā² = 2.89
- 1 student had a squared difference of 83.3Ā² = 6938.89

- Sum the squared differences
- 49 x 2.89 = 141.61
- 1 x 6938.89 (notice how this 1 studentās difference swamped all the other studentsā differences combined)

141.61 + 6938.89 =

**7080.5**Ā

- Find the mean of the squared differences
- 7080.5 / 50 students = 141.61
The variance =
**141.61**

- Compute the standard deviation
- sqrt(141.61) = 11.9

Ā

The standard deviation of scores on this test is

**11.9**Ā

Ā

Youāre jumping up and down ā āThese scores are not distributed like a bell curve!ā

Thereās a single outlier and everyone else scored the same.

Ā

**The standard deviation doesnāt feel like a number that represents a typical result. It feels off here.**Ā

#### Mean Absolute Deviation (MAD)

Ā

An alternative to the standard deviation is the mean absolute deviation. The recipe for computing it feels similar to standard deviation but we donāt square differences.

The outliers donāt get exponentially weighted.

Ā

To compute the MAD for the test scores:

- Sum all the absolute differences from the mean
- We count 49 differences of 1.7 from the mean of 83.3
- We count one difference of 83.3 (ie abs[0-83.3])

Ā

sum of absolute differences = 49 x 1.7 + 83.3 =

**166.6**Ā

Note that the one outlier represents half of the total differences in this example ā but this is a much smaller weight than that outlier had on the total variance when we squared the differences.

- Take the average difference from the mean
- 166.6 / 50 = 3.33

Thatās itā¦the MAD is

**3.33**Ā

**More practice**

Ā

*Compute the mean, standard deviation, and mean absolute deviation (MAD) for rolling 2 dice.*Ā

## Solution

#### Relating MAD to SD

Ā

With our test example, we computed 2 different measures of spread or variation.

Ā

Standard deviation =

**11.9**MAD =

**3.33**Ā

Youāll notice that MAD is smaller than SD.

**This is always true.**Squaring vs not squaring. There are formal proofs of this online as well.Ā

In this example, the MAD is 27% of the SD.

Ā

**Iād say that the MAD did a better job of telling us what was typical ā most students scored closely to the mean.**Ā

But is the 27% ratio of MAD to SD mean anything? Is it normal for those stats to differ by that much?

Ā

If you worked out the solution to the dice problem above in

*More Practice*, youāll find that the MAD is 86% of the SD. In other words, they are quite close.Ā

We also know that the sum of 2 dice looks symmetrical like a pyramid. If there were many more sides on each die the results would probably start moving from a pyramid shape to a more continuous bell curve shape.

Ā

**It turns out that a Gaussian distribution has a fixed ratio of MAD to SD!**Ā

ā¦where

*~*.80Ā

Ā

**Key Takeaways**

Ā

If the underlying distribution is Gaussian:

#### MAD = .8 x SD

#### SD = 1.25 x MAD

Ā

You could expect the ratio to differ for non-Gaussian distributions. When examining data, computing both statistics can give you a clue about its nature.

In the text example above, the MAD/SD ratio of only 27% is a clue:

*Even though the MAD is more useful than SD for telling us what outcomes are typical, the ratio indicates that there are some highly skewed outliers.*

Ā

Ā

**Learn more**

Ā

This is a masterful thread by @10kdiver:

Ā