27 Variability

Rebecca Anguiano

Learning Objectives

By the end of this chapter, you will be able to

  1. Define variability and its purpose in statistics.
  2. Compute measures of variability such as range, interquartile range, standard deviation, and variance to draw conclusions about data sets.

Spread and Variability

Variability refers to how “spread out” a group of scores is. To see what we mean by spread out, consider the graphs in Figure 27.1. These graphs represent the scores on two quizzes. The mean score for each quiz is 7.0. Despite the equality of means, you can see that the distributions are quite different. Specifically, the scores on Quiz 1 are more densely packed, and those on Quiz 2 are more spread out. The differences among students were much greater on Quiz 2 than on Quiz 1.

Side-by-side bar charts: Quiz 1 scores cluster at 6–8; Quiz 2 scores are spread 4–10 more evenly. (image description available)
Figure 27.1. Bar charts of Quizzes 1 and 2. [Image Description]

The terms variability, spread, and dispersion are synonyms and refer to how spread out a distribution is. Just as in the section on central tendency, where we discussed measures of the center of a distribution of scores, in this section, we will discuss measures of the variability of a distribution. There are three frequently used measures of variability: range, variance, and standard deviation. In the next few paragraphs, we will look at each of these measures of variability in more detail.

Range

The range is the simplest measure of variability to calculate, and one you have probably encountered many times in your life. The range is simply the highest score minus the lowest score. Let’s take a few examples. What is the range of the following group of numbers: 10, 2, 5, 6, 7, 3, 4? Well, the highest number is 10, and the lowest number is 2, so 10 − 2 = 8. The range is 8. Let’s take another example. Here’s a dataset with 10 numbers: 99, 45, 23, 67, 45, 91, 82, 78, 62, 51. What is the range? The highest number is 99 and the lowest number is 23, so 99 − 23 = 76; the range is 76. Now, consider the two quizzes shown in Figure 27.1. On Quiz 1, the lowest score is 5 and the highest score is 9. Therefore, the range is 4. The range on Quiz 2 was larger: the lowest score was 4, and the highest score was 10. Therefore, the range is 6.

The problem with using range is that it is extremely sensitive to outliers, and one number far away from the rest of the data will greatly alter the value of the range. For example, in the set of numbers 1, 3, 4, 4, 5, 8, and 9, the range is 8 (9 − 1). However, if we add a single person whose score is nowhere close to the rest of the scores, say, 20, the range more than doubles from 8 to 19.

Interquartile Range

The interquartile range (IQR) is the range of the middle 50% of the scores in a distribution and is sometimes used to communicate where the bulk of the data in the distribution are located. It is computed as follows:

IQR = 75th percentile − 25th percentile

For Quiz 1, the 75th percentile is 8 and the 25th percentile is 6. The interquartile range is therefore 2. For Quiz 2, which has greater spread, the 75th percentile is 9, the 25th percentile is 5, and the interquartile range is 4. Recall that in the discussion of box plots, the 75th percentile was called the upper hinge, and the 25th percentile was called the lower hinge. Using this terminology, the interquartile range is referred to as the H-spread.

Sum of Squares

Variability can also be defined in terms of how close the scores in the distribution are to the middle of the distribution. Using the mean as the measure of the middle of the distribution, we can see how far, on average, each data point is from the center. The data from Quiz 1 are shown in Table 27.1.

There are a few things to note about how Table 27.1 is formatted. The raw data scores (X) are always placed in the left-most column. This column is then summed at the bottom (ΣX) to facilitate calculating the mean by dividing the sum of X values by the number of scores in the table (N). The mean score is 7.0 (ΣX/N = 140/20 = 7.0). Once you have the mean, you can easily work your way down the second column calculating the deviation scores (X - M), representing how far each score deviates from the mean, here calculated as the score (X value) minus 7. This column is also summed and has a very important property: it will always sum to 0, or close to zero if you have rounding error due to many decimal places (Σ(X - M) = 0). This step is used as a check on your math to make sure you haven’t made a mistake. If this column sums to 0, you can move on to filling in the third column, which is composed of the squared deviation scores. The deviation scores are squared to remove negative values and appear in the third column (X - M)2 . When these values are summed, you have the sum of the squared deviations, or the sum of squares (SS), calculated with the formula [latex]SS = \sum\nolimits (X - M)^{2}[/latex] .

Table 27.1. Calculation of Variance for Quiz 1 Scores.

X

XM

(XM)²

X²

9

2

4

81

9

2

4

81

9

2

4

81

8

1

1

64

8

1

1

64

8

1

1

64

8

1

1

64

7

0

0

49

7

0

0

49

7

0

0

49

7

0

0

49

7

0

0

49

6

−1

1

36

6

−1

1

36

6

−1

1

36

6

−1

1

36

6

−1

1

36

6

−1

1

36

5

−2

4

25

5

−2

4

25

[latex]\displaystyle \sum\nolimits X = 140[/latex]

[latex]\displaystyle (\sum\nolimits X)^{2}=19,600[/latex]

[latex]\displaystyle \sum\nolimits (X - M) = 0[/latex] [latex]\displaystyle \sum\nolimits (X - M)^{2} = 30[/latex] [latex]\displaystyle \sum\nolimits X^{2}=1,010[/latex]

[latex]\displaystyle SS = 4+4+4+1+1+1+1+0+0+0+0+0+1+1+1+1+1+1+4+4 = 30[/latex]

The preceding formula is called the definitional formula, as it shows the logic behind the sum of squared deviations calculation. As mentioned earlier, there can be rounding errors in calculating the deviation scores. Also, when the set of scores is large, calculating the deviation scores, squaring the scores, and then summing those values can be tedious. To simplify the sum of squares calculation, the computational formula is used instead. The computational formula is as follows:

[latex]\displaystyle SS \;=\; \sum X^{2}\;-\;\frac{(\sum X)^{2}}{N}[/latex]

The last column in Table 27.1 represents the X values squared and then summed—[latex]\sum\nolimits X^{2}[/latex]. At the bottom of the first column, the [latex]\sum\nolimits X[/latex] value is squared­—[latex](\sum\nolimits X)^{2}[/latex]. These are the values used in the computational formula for the sum of squares. As you can see in the calculation below, the SS value is the same for both the definitional formula and the computational formula:

 

[latex]\displaystyle SS \;=\; \sum X^{2}\;-\;\frac{(\sum X)^{2}}{N}\;=\;1{,}010\;-\;\frac{19{,}600}{20}\;=\;30[/latex]

As we will see, the sum of squares appears again and again in different formulas—it is a very important value, and using the X and X2 columns in this table makes it simple to calculate the SS without error.

Variance

Now that we have the sum of squares calculated, we can use it to compute our formal measure of average distance from the mean—the variance. The variance is defined as the average squared difference of the scores from the mean. We square the deviation scores because, as we saw in the second column of Table 27.1, the sum of raw deviations is always 0, and there’s nothing we can do mathematically without changing that.

The population parameter for variance is σ² (“sigma-squared”) and is calculated as:

[latex]\displaystyle \sigma^{2} = \frac{SS}{N}[/latex]

We can use the value we previously calculated for SS in the numerator, then simply divide that value by N to get the variance. If we assume that the values in Table 27.1 represent the full population, then we can take our value of the sum of squares and divide it by N to get our population variance:

[latex]\displaystyle \sigma^{2}=\frac{30}{20}=1.5[/latex]

So, on average, scores in this population are 1.5 squared units away from the mean. This measure of spread exhibits much more robustness (a term used by statisticians to mean resilience or resistance to outliers) than the range, so it is a much more useful value to compute. Additionally, as we will see in future chapters, variance plays a central role in inferential statistics.

The sample statistic used to estimate the variance is s² (“s-squared”):

[latex]\displaystyle s^{2}=\frac{SS}{N-1}=\frac{SS}{df}[/latex]

This formula is very similar to the formula for the population variance with one change: we now divide by N − 1 instead of Upper N. The value N − 1 has a special name: the degrees of freedom (abbreviated as df). You don’t need to understand in depth what degrees of freedom are (essentially, they account for the fact that we have to use a sample statistic to estimate the mean [Upper M] before we estimate the variance) in order to calculate variance, but knowing that the denominator is called df provides a nice shorthand for the variance formula:

[latex]\displaystyle \frac{SS}{df}[/latex]

Going back to the values in Table 27.1 and treating those scores as a sample, we can estimate the sample variance as:

[latex]\displaystyle s^{2}=\frac{30}{20-1}=1.58[/latex]

Notice that this value is slightly larger than the one we calculated when we assumed these scores were the full population. This is because our value in the denominator is slightly smaller, making the final value larger. In general, as your sample size Upper N gets bigger, the effect of subtracting 1 becomes less and less. Comparing a sample size of 10 to a sample size of 1000; 10 − 1 = 9, or 90% of the original value, whereas 1000 − 1 = 999, or 99.9% of the original value. Thus, larger sample sizes will bring the estimate of the sample variance closer to that of the population variance. This is a key idea and principle in statistics that we will see over and over again: larger sample sizes better reflect the population.

Standard Deviation

The standard deviation is simply the square root of the variance. This is a useful and interpretable statistic because taking the square root of the variance (recalling that variance is the average squared difference) puts the standard deviation back into the original units of the measure we used. Thus, when reporting descriptive statistics in a study, scientists virtually always report mean and standard deviation. Standard deviation is therefore the most commonly used measure of spread for our purposes, representing the average distance of the scores from the mean.

The population parameter for standard deviation is σ (“sigma”), which, intuitively, is the square root of the variance parameter σ² (occasionally, the symbols work out nicely that way). The formula is simply the formula for variance under a square root sign:

[latex]\sigma=\sqrt{\dfrac{SS}{N}}=\sqrt{\dfrac{30}{20}}=\sqrt{1.5}=1.22[/latex]

The sample statistic follows the same conventions and is given as s in mathematical formulas. (Note that in American Psychological Association [APA] format for reporting results, sample standard deviation is reported using the abbreviation SD.)

[latex]\displaystyle s=\sqrt{\frac{SS}{df}}=\sqrt{\frac{30}{20-1}}=\sqrt{1.58}=1.26[/latex]

The standard deviation is an especially useful measure of variability when the distribution is normal or approximately normal because the proportion of the distribution within a given number of standard deviations from the mean can be calculated. For example, 68% of the distribution is within one standard deviation (above and below) of the mean and approximately 95% of the distribution is within two standard deviations of the mean, as shown in Figure 27.2. Therefore, if you had a normal distribution with a mean of 50 and a standard deviation of 10, then 68% of the distribution would be between 50 − 10 = 40 and 50 + 10 = 60. Similarly, about 95% of the distribution would be between 50 − 2 × 10 = 30 and 50 + 2 × 10 = 70.

Normal curve shaded to show the 68–95–99.7 rule. (image description available)
Figure 27.2. Percentages of the Normal Distribution. [Image Description]

Figure 27.3 shows two normal distributions. The red (left-most) distribution has a mean of 40 and a standard deviation of 5; the blue (right-most) distribution has a mean of 60 and a standard deviation of 10. For the red distribution, 68% of the distribution is between 45 and 55; for the blue distribution, 68% is between 50 and 70. Notice that as the standard deviation gets smaller, the distribution becomes much narrower, regardless of where the center of the distribution (mean) is. Figure 27.4 presents several more examples of this effect.

Two normal curves—narrow peak near 42 (smaller SD) and wider peak near 60 (larger SD); overlap around 50 (image description available)
Figure 27.3. Normal Distributions with Standard Deviations of 5 and 10. [Image Description]
Four mini plots compare two normal curves. (image description available)
Figure 27.4. Differences Between Two Datasets. [Image Description]

Equity Activity: Understanding variability in educational outcomes

A school district is investigating whether students in different neighborhoods have equal access to high-quality education. They collect standardized math test scores from three middle schools serving distinct neighborhoods:

  • School A: Affluent neighborhood

  • School B: Mixed-income neighborhood

  • School C: Low-income neighborhood

Each school tested 100 students. The mean math score and standard deviation (SD) of scores are shown below:

Table 27.2. Mean and Standard Deviations of Three Middle Schools
School Mean Score Standard Deviation
School A 82 5
School B 75 10
School C 71 18

 

Practice Problems

Test Your Knowledge

License & Attribution

“Variability” by Rebecca Anguiano is adapted from "Measures of Central Tendency and Spread" by Linda R. Cote Ph.D.; Rupa G. Gordon Ph.D., Chrislyn E. Randell Ph.D., Judy Schmitt, and Helena Marvin, which is licensed CC BY-NC-SA 4.0.

“Variability” is licensed under CC BY-NC-SA 4.0.


Image Descriptions

Figure 27.1. Two bar charts compare score frequency (y-axis 0–7) by Score (x-axis 4–10). QUIZ 1 counts: 5=2, 6=6 (highest), 7=5, 8=4, 9=3; 4 and 10=0. QUIZ 2 counts: 4=2, 5=4, 6=3, 7=3, 8=2, 9=3, 10=3. Quiz 1 is tightly centered around 6–8; Quiz 2 is more even across scores. [Return to Figure 27.1]

Figure 27.2. A bell-shaped normal distribution is centered at 0 with x-axis ticks from –3 to +3 standard deviations. Shading highlights coverage: the middle band from –1 to +1 SD (orange) is labeled 68%; the wider band from –2 to +2 SD (orange plus purple) is labeled 95%; nearly the whole curve from –3 to +3 SD (orange, purple, and red tails) is labeled 99.7%. Horizontal dotted arrows mark each percentage span. [Return to Figure 27.2]

Figure 27.3. Line chart with x-axis from 0–100 shows two bell curves. A magenta solid curve is tall and narrow, centered around ~42, indicating a smaller standard deviation. A teal dashed curve is shorter and wider, centered around ~60, indicating a larger standard deviation. The curves overlap modestly between about 48–55. The figure contrasts equal-shape distributions with different spreads and means. [Return to Figure 27.3]

Figure 27.4. Grid of four panels titled A–D with y-axis “Relative Frequency.” Each panel shows a magenta solid curve and a teal dashed curve. A. Two identical sets: curves overlap completely (same mean and variability). B. Locations differ: curves have similar width but distinct centers (different means). C. Variabilities differ: curves share the same center; magenta is narrow/tall, teal is wider/shorter (different standard deviations). D. Locations and variabilities differ: curves have different centers and spreads. The figure illustrates how distributions can vary by mean and/or variability. [Return to Figure 27.4]

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Critical Research Methods in Psychology Copyright © 2025 by Stephanie D'Costa; Mireille Ukeye; Makenzie O'Neil; and Rebecca Anguiano is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.