Measures of dispersion: variance and standard deviation

, محدث •0•0Comment iconComment iconComment iconComment icon

Variance and standard deviation for raw and grouped data, population vs. sample (n or n − 1), properties and the coefficient of variation, with exercises.

Writer image

تمت الترجمة بواسطةEditorial

Writer image

تمت المراجعة بواسطةEditorial

تحرير المادة

Why study the standard deviation

When listening to different hearts, the number of beats per minute already gives a clue about the heart's owner: a fetus's heart, for example, beats much faster than an adult's. Knowing the position (the mean) of the data set is important, but it is often not the only thing to analyze. To find out whether a patient has heart problems, the doctor looks not only at the number of beats per minute but also at the rhythm on the electrocardiogram: whether the heart changes its pace a lot or not. In other words, how spread out the intervals between beats are compared with the mean. Notice the difference between the following recordings:

Can you tell which heart has an arrhythmia?

Let's look at another example. Consider the following series:

X: 70, 70, 70, 70, 70

Y: 68, 69, 70, 71, 72

Z: 0, 10, 70, 110, 160

The arithmetic mean of each series is 70, the median of all three is 70, and only series X has a mode. Even so, the three are clearly very different.

Dispersion or variability is the degree to which the values of a variable spread around a central value taken as a point of comparison. In the example, X has zero dispersion, and Y has much less dispersion than Z.

In the chart below, the points spread around the line: this distance from a central value is what measures of dispersion quantify.

Image content of the Website

Two machines fill 500 g packets. In a sample, machine A produced 498, 500, 502 g and machine B produced 480, 500, 520 g. What can be said?

Loading icon

Answer: Both have the same mean, but B has much greater dispersion — both average 500 g, but B misses by up to 20 g either way, against 2 g for A. This is exactly the case where the mean alone hides the difference and a measure of dispersion is needed.

How to calculate the variance and the standard deviation

The most widely used measures of dispersion, because they take every value into account, are the variance and the standard deviation.

The variance is based on the deviations from the arithmetic mean: it is the mean of the squared deviations. We square them because, as we saw in the lesson on measures of position, the sum of the deviations is always zero; once squared, they are all positive. When the data are the whole population (every element of interest), the variance is written σ² and calculated as:

\[ \sigma^{2} = \frac{\sum{(x_i - \bar{x})^{2}}}{n} \]

When the data are a sample and we want to estimate the variance of the population it came from, we divide by n − 1 instead of n (this is the so-called sample variance, written s²):

\[ s^{2} = \frac{\sum{(x_i - \bar{x})^{2}}}{n - 1} \]

Dividing by n − 1 corrects the sample's tendency to underestimate the variability of the population. With a lot of data, the difference between the two formulas is small; with little data, it is large. In the examples and exercises of this lesson, as in basic descriptive statistics textbooks, the data are treated as a population (we divide by n), and we also show the sample value for comparison.

Since the variance is calculated from squared deviations, it is in squared units (cm², kg², dollars²), which is inconvenient in practice. That is why we use the standard deviation, which is the square root of the variance and returns to the same unit as the data:

\[ \sigma = \sqrt{\sigma^{2}} \qquad s = \sqrt{s^{2}} \]

Properties

1st: The standard deviation is always positive or zero. The standard deviation of a constant is zero.

2nd: Adding (or subtracting) a constant c to all values of a variable leaves the standard deviation unchanged (a property called translation invariance).

3rd: Multiplying (or dividing) all values of a variable by a constant c multiplies (or divides) the standard deviation by the absolute value of that constant.

For example, if series Y (standard deviation of about 1.41) is converted from kilograms to grams, multiplying everything by 1,000, the standard deviation becomes about 1,414; if we add 5 to every value, it stays at 1.41.

Standard deviation of ungrouped data

Take as an example the following series of the variable x:

x: 40, 45, 48, 52, 54, 62, 70

The mean is 371 / 7 = 53. The most practical way to calculate the standard deviation is to build a table with the deviations and their squares:

xMeanDeviationSquared deviation
4053-13169
4553-864
4853-525
5253-11
5453+11
6253+981
7053+17289

\[ \text{Sum of squared deviations} = 630 \]

\[ \text{Number of elements} = 7 \]

\[ \text{Variance (population)} = \frac{630}{7} = 90 \]

\[ \text{Standard deviation (population)} = \sqrt{90} \approx 9.49 \]

If these 7 values were a sample, we would have s² = 630 / 6 = 105 and s ≈ 10.25.

Standard deviation of grouped data: without class intervals

When there are frequencies, each squared deviation is multiplied by the frequency of the value, and the total number of elements is the sum of the frequencies:

\[ \sigma^{2} = \frac{\sum{f_i \cdot (x_i - \bar{x})^{2}}}{\sum{f_i}} \]

Example (mean = 63 / 30 = 2.1):

xFrequencyMeanDeviationSquared deviationSquared deviation × frequency
022.1-2.14.418.82
162.1-1.11.217.26
2122.1-0.10.010.12
372.1+0.90.815.67
432.1+1.93.6110.83

\[ \text{Sum of squared deviations times frequency} = 32.7 \]

\[ \text{Number of elements} = 30 \]

\[ \text{Variance} = \frac{32.7}{30} = 1.09 \]

\[ \text{Standard deviation} = \sqrt{1.09} \approx 1.044 \]

(As a sample: s² = 32.7 / 29 ≈ 1.128 and s ≈ 1.062.)

Standard deviation of grouped data: with class intervals

With class intervals, the midpoint is used as the value of the class.

Example:

ClassMidpointFrequencyMeanDeviationSquared deviationSquared deviation × frequency
0 |— 2125-41632
2 |— 4325-248
4 |— 6525000
6 |— 8725+248
8 |—| 10925+41632

\[ \text{Sum of squared deviations times frequency} = 80 \]

\[ \text{Number of elements} = 10 \]

\[ \text{Variance} = \frac{80}{10} = 8 \]

\[ \text{Standard deviation} = \sqrt{8} \approx 2.83 \]

(As a sample: s² = 80 / 9 ≈ 8.89 and s ≈ 2.98.)

The waiting times, in minutes, of four customers were 2, 4, 4 and 6. Treating the data as a population, what are the variance and the standard deviation?

Loading icon

Answer: Variance 2 and standard deviation 1.41 — the mean is 16 / 4 = 4; the squared deviations are 4, 0, 0, 4, which add up to 8; 8 / 4 = 2 and the square root of 2 is 1.41. The option 2.67 and 1.63 is the sample variance (8 / 3), which would apply if the four customers were a sample of all customers.

The grades of a class have a standard deviation of 1.5. The teacher gives everyone 1 extra point and then converts the grades from a 0 to 10 scale to a 0 to 100 scale (multiplying by 10). What is the new standard deviation?

Loading icon

Answer: 15 — adding 1 point to everyone does not change the standard deviation (property 2); multiplying by 10 multiplies the standard deviation by 10 (property 3): 1.5 × 10 = 15. The option 25 comes from multiplying (1.5 + 1) by 10, applying the addition to the standard deviation, which is wrong.

Coefficient of variation

The standard deviation alone does not tell us much. A standard deviation of 2 units may be considered small for a series whose mean is 200; but if the mean is 20, the same cannot be said.

Moreover, since the standard deviation is expressed in the same unit as the data, it cannot be used to compare the dispersion of series with different units or orders of magnitude (heights in centimeters and weights in kilograms, for example).

To get around these difficulties, we use the coefficient of variation (CV), which measures the standard deviation as a proportion of the mean and is usually expressed as a percentage:

\[ CV = \frac{\sigma}{\bar{x}} \times 100\% \]

So, in the last example:

\[ \text{Standard deviation} \approx 2.83 \]

\[ \text{Mean} = 5 \]

\[ CV = \frac{2.83}{5} \approx 0.566 = 56.6\% \]

The higher the CV, the more spread out the data are relative to the mean. A common rule of thumb in Brazilian textbooks considers dispersion low with a CV up to about 15%, medium between 15% and 30%, and high above 30%; in the example, 56.6% indicates high dispersion.

At store A, daily sales have a mean of $2,000 and a standard deviation of $300. At store B, a mean of $500 and a standard deviation of $100. Which store has relatively more unstable sales?

Loading icon

Answer: Store B, because its coefficient of variation is larger — CV of A = 300 / 2,000 = 15%; CV of B = 100 / 500 = 20%. A's standard deviation is larger in dollars, but it also sells four times as much; comparing standard deviations of such different means is misleading, and that is what the CV is for.

Exercises

1) Calculate the standard deviation of the following sets:

a) 1, 3, 4, 9;

b) 20, 14, 15, 19, 21, 22, 20.

2) Calculate the standard deviation of the following sets:

a) 17.9; 22.5; 13.3; 16.8; 15.4; 14.2;

b) −10, −6, 2, 3, 7, 9, 10.

3) Calculate the standard deviation of the following distribution:

XFrequency
21
33
45
58
65
74
82

4) Calculate the standard deviation of the following distribution:

XFrequency
1.5 |— 1.64
1.6 |— 1.78
1.7 |— 1.812
1.8 |— 1.915
1.9 |— 2.012
2.0 |— 2.18
2.1 |— 2.24

5) Given that a data set has an arithmetic mean of 18.3 and a standard deviation of 1.47, calculate the coefficient of variation.

6) In a final Mathematics exam, the mean grade of a group of 150 students was 7.8 and the standard deviation 0.80. In Statistics, the final mean grade was 7.3 and the standard deviation 0.76. In which subject was the relative dispersion greater?

7) Measuring the heights of 1,017 individuals, we obtained a mean of 162.2 cm and a standard deviation of 8.01 cm. The mean weight of these same individuals is 52 kg, with a standard deviation of 2.3 kg. Do these individuals show greater variability in height or in weight?

8) A group of one hundred students has a mean height of 163.8 cm, with a coefficient of variation of 3.3%. What is the standard deviation of this group?

9) A distribution has the following statistics: standard deviation = 1.5 and CV = 2.9%. Find the mean of the distribution.

Answer key

In exercises 1 to 4, the first value treats the data as a population (divides by n) and the value in parentheses as a sample (divides by n − 1).

1) a) 2.95 (sample: 3.40); b) 2.81 (sample: 3.04)

2) a) 3.02 (sample: 3.30); b) 7.04 (sample: 7.60)

3) 1.51 (sample: 1.54)

4) 0.159 (sample: 0.161)

5) 1.47 / 18.3 ≈ 8.03%

6) Statistics (CV of 10.4%, against 10.3% in Mathematics)

7) Height (CV of 4.9%, against 4.4% for weight)

8) 0.033 × 163.8 ≈ 5.41 cm

9) 1.5 / 0.029 ≈ 51.7

ما رأيك في هذا المقال؟

0%
تقييم المستخدمين (0)

شارك هذا المقال!