<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# Variance of a Data Set

## The mean of the squares of the deviation of data values

Estimated18 minsto complete
%
Progress
Practice Variance of a Data Set

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated18 minsto complete
%
Variance of a Data Set

### Variance of a Data Set

To calculate the variance (σ2)\begin{align*}(\sigma^2)\end{align*} for a population of normally distributed data:

Step 1: Determine the mean of the data values.

Step 2: Subtract the mean of the data from each value in the data set to determine the difference between the data value and the mean: (xμ)\begin{align*}(x-\mu)\end{align*}.

Step 3: Square each of these differences and determine the total of these positive, squared results.

Step 4: Divide this sum by the number of values in the data set.

These steps for calculating the variance of a data set for a population can be summarized in the following formula:

σ2=(xμ)2n\begin{align*}\sigma^2 = \frac{\sum(x-\mu)^2}{n}\end{align*}

where:

x\begin{align*}x\end{align*} is a data value.

μ\begin{align*}\mu\end{align*} is the population mean.

n\begin{align*}n\end{align*} is number of data values (population size).

These steps for calculating the variance of a data set for a sample can be summarized in the following formula:

s2=(xx¯¯¯)2n1\begin{align*}s^2 = \frac{\sum(x-\overline{x})^2}{n-1}\end{align*}

where:

x\begin{align*}x\end{align*} is a data value.

x¯¯¯\begin{align*}\overline{x}\end{align*} is the sample mean.

n\begin{align*}n\end{align*} is number of data values (sample size).

The only difference in the formulas is the number by which the sum is divided. For a population, it is divided by n\begin{align*}n\end{align*}, and for a sample, it is divided by n1\begin{align*}n - 1\end{align*}.

#### Calculating the Variance of a Data Set

1. A company wants to test its exterior house paint to determine how long it will retain its original color before fading. The company mixes 2 brands of paint by adding different chemicals to each brand. 6 one-gallon cans are made for each paint brand, and the results are recorded for every gallon of each brand of paint. The following are the results obtained in the laboratory. Calculate the variance of the 2 brands of paint. These are both small populations.

Brand A (Time in months) Brand B (Time in months)
15 40
65 50
55 35
35 40
45 45
25 30

Brand A

x\begin{align*}x\end{align*} (xμ)\begin{align*}(x-\mu)\end{align*} (xμ)2\begin{align*}(x-\mu)^2\end{align*}
15 25\begin{align*}-25\end{align*} 625
65 25 625
55 15 225
35 5\begin{align*}-5\end{align*} 25
45 5 25
25 15\begin{align*}-15\end{align*} 225

μσ2σ2=15+65+55+35+45+256=2406=40=(xμ)2n=625+625+225+25+25+2256=1,7506291.66¯¯¯¯¯\begin{align*}\mu&=\frac{15+65+55+35+45+25}{6}=\frac{240}{6}=40\\ \sigma^2 & = \frac{\sum (x- \mu)^2}{n}\\ \sigma^2 & = \frac{625+625+225+25+25+225}{6} = \frac{1,750}{6} \approx 291.\overline{66}\end{align*}

Brand B

x\begin{align*}x\end{align*} (xμ)\begin{align*}(x-\mu)\end{align*} (xμ)2\begin{align*}(x-\mu)^2\end{align*}
40 0 0
50 10 100
35 5\begin{align*}-5\end{align*} 25
40 0 0
45 5 25
30 10\begin{align*}-10\end{align*} 100

μσ2σ2=40+50+35+40+45+306=2406=40=(xμ)2n=0+100+25+0+25+1006=250641.66¯¯¯¯¯\begin{align*}\mu&=\frac{40+50+35+40+45+30}{6}=\frac{240}{6}=40\\ \sigma^2 & = \frac{\sum (x-\mu)^2}{n}\\ \sigma^2 & = \frac{0+100+25+0+25+100}{6} = \frac{250}{6} \approx 41.\overline{66}\end{align*}

The variance is simply the average of the squares of the distance of each data value from the mean. If these data values are close to the value of the mean, the variance will be small. This was the case for Brand B. If these data values are far from the mean, the variance will be large, as was the case for Brand A.

The variance of a data set is always a positive value.

2. What would the variances of the 2 data sets in the previous example have been had they been samples instead of small populations?

First, let's calculate the variance of the data set for Brand A had it been a sample:

x¯s2s2=15+65+55+35+45+256=2406=40=(xx¯)2n1=625+625+225+25+25+2255=1,7505=350\begin{align*}\bar{x}&=\frac{15+65+55+35+45+25}{6}=\frac{240}{6}=40\\ s^2 & = \frac{\sum (x- \bar{x})^2}{n-1}\\ s^2 & = \frac{625+625+225+25+25+225}{5} = \frac{1,750}{5}=350\end{align*}

Next, let's calculate the variance of the data set for Brand B had it been a sample:

x¯s2s2=40+50+35+40+45+306=2406=40=(xx¯)2n1=0+100+25+0+25+1005=2505=50\begin{align*}\bar{x}&=\frac{40+50+35+40+45+30}{6}=\frac{240}{6}=40\\ s^2 & = \frac{\sum (x-\bar{x})^2}{n-1}\\ s^2 & = \frac{0+100+25+0+25+100}{5} = \frac{250}{5}=50\end{align*}

Notice that, as in the previous example, the variance of the data set for Brand A is much larger than the variance of the data set for Brand B.

3. The following data represents the morning temperatures (C)\begin{align*}(^\circ \text{C})\end{align*} and the monthly rainfall (mm) in July for all the Canadian cities east of Toronto:

Temperature (C)\begin{align*}(^\circ \text{C})\end{align*}

11.713.710.5 14.213.914.210.416.116.44.8  15.213.0 14.412.78.6 12.911.514.6\begin{align*}& 11.7 \quad 13.7 \quad 10.5 \quad \ 14.2 \quad 13.9 \quad 14.2 \quad 10.4 \quad 16.1 \quad 16.4\\ & 4.8 \quad \ \ 15.2 \quad 13.0 \quad \ 14.4 \quad 12.7 \quad 8.6 \quad \ 12.9 \quad 11.5 \quad 14.6\end{align*}

Precipitation (mm)

18.637.170.9 102 59.958.073.077.6 89.186.640.3119.536.285.559.297.8122.282.6\begin{align*}& 18.6 \quad 37.1 \quad 70.9 \quad \ 102 \quad \ 59.9 \quad 58.0 \quad 73.0 \quad 77.6 \quad \ 89.1\\ & 86.6 \quad 40.3 \quad 119.5 \quad 36.2 \quad 85.5 \quad 59.2 \quad 97.8 \quad 122.2 \quad 82.6\end{align*}

Calculate the variance for each data set. Which data set is more variable? Both are small populations.

Temperature
x\begin{align*}x\end{align*} (xμ)\begin{align*}(x-\mu)\end{align*} (xμ)2\begin{align*}(x-\mu)^2\end{align*}
11.7 1\begin{align*}-1\end{align*} 1
13.7 1 1
10.5 2.2\begin{align*}-2.2\end{align*} 4.84
14.2 1.5 2.25
13.9 1.2 1.44
14.2 1.5 2.25
10.4 2.3\begin{align*}-2.3\end{align*} 5.29
16.1 3.4 11.56
16.4 3.7 13.69
4.8 7.9\begin{align*}-7.9\end{align*} 62.41
15.2 2.5 6.25
13.0 0.3 0.09
14.4 1.7 2.89
12.7 0 0
8.6 4.1\begin{align*}-4.1\end{align*} 16.81
12.9 0.2 0.04
11.5 1.2\begin{align*}-1.2\end{align*} 1.44
14.6 1.9 3.61

μσ2σ2=xn=228.61812.7=(xμ)2n=136.86187.6\begin{align*}\mu&= \frac{\sum x}{n} = \frac{228.6}{18} \approx 12.7\\ \sigma^2 & = \frac{\sum (x-\mu)^2}{n}\\ \sigma^2 & = \frac{136.86}{18} \approx 7.6\end{align*}

The variance of the data set is approximately 7.6 C\begin{align*}7.6 \ ^\circ \text{C}\end{align*}.

Precipitation (mm)
x\begin{align*}x\end{align*} (xμ)\begin{align*}(x-\mu)\end{align*} (xμ)2\begin{align*}(x-\mu)^2\end{align*}
18.6 54.5\begin{align*}-54.5\end{align*} 2970.3
37.1 36.0\begin{align*}-36.0\end{align*} 1296
70.9 2.2\begin{align*}-2.2\end{align*} 4.84
102.0 28.9 835.21
59.9 13.2\begin{align*}-13.2\end{align*} 174.24
58.0 15.1\begin{align*}-15.1\end{align*} 228.01
73.0 0.1\begin{align*}-0.1\end{align*} 0.01
77.6 4.5 20.25
89.1 16.0 256
86.6 13.5 182.25
40.3 32.8\begin{align*}-32.8\end{align*} 1075.8
119.5 46.4 2153
36.2 36.9\begin{align*}-36.9\end{align*} 1361.6
85.5 12.4 153.76
59.2 13.9\begin{align*}-13.9\end{align*} 193.21
97.8 24.7 610.09
122.2 49.1 2410.8
82.6 9.5 90.25

μσ2σ2=xn=1,316.11873.1=(xμ)2n=14,01618778.66¯¯¯¯¯\begin{align*}\mu&= \frac{\sum x}{n} = \frac{1,316.1}{18} \approx 73.1\\ \sigma^2 & = \frac{\sum (x-\mu)^2}{n}\\ \sigma^2 & = \frac{14,016}{18} \approx 778.\overline{66}\end{align*}

The variance of the data set is approximately 778.66 mm.

Therefore, the data values for the precipitation are more variable. This is indicated by the large variance of the data set.

-->

### Example

#### Example 1

A consumer advocacy magazine wants to compare 2 brands of incandescent lamps. The magazine took samples of each brand, with each sample consisting of 10 lamps. All of the lamps in both of the samples were allowed to burn as long as they could, and the times were recorded in hours. The following are the results obtained from the magazine. Calculate the variance of the samples of the 2 brands of incandescent lamps. Which brand has the more variable burning times?

Brand A (Time in hours) Brand B (Time in hours)
760 820
790 900
800 810
780 790
850 810
790 800
750 850
820 820
810 920
800 890

Brand A

x\begin{align*}x\end{align*} (xx¯)\begin{align*}(x-\bar{x})\end{align*} (xx¯)2\begin{align*}(x-\bar{x})^2\end{align*}
760 35\begin{align*}-35\end{align*} 1,225
790 5\begin{align*}-5\end{align*} 25
800 5 25
780 15\begin{align*}-15\end{align*} 225
850 55 3,025
790 5\begin{align*}-5\end{align*} 25
750 45\begin{align*}-45\end{align*} 2,025
820 25 625
810 15 225
800 5 25

x¯s2s2=760+790+800+780+850+790+750+820+810+80010=7,95010=795=(xx¯)2n1=1,225+25+25+225+3,025+25+2,025+625+225+259=7,4509827.77¯¯¯¯¯\begin{align*}\bar{x}&=\frac{760+790+800+780+850+790+750+820+810+800}{10}=\frac{7,950}{10}=795\\ s^2 & = \frac{\sum (x- \bar{x})^2}{n-1}\\ s^2 & = \frac{1,225+25+25+225+3,025+25+2,025+625+225+25}{9} = \frac{7,450}{9} \approx 827.\overline{77}\end{align*}

The variance of the burning times for Brand A is approximately 827.78 hours.

Brand B

x\begin{align*}x\end{align*} (xx¯)\begin{align*}(x-\bar{x})\end{align*} (xx¯)2\begin{align*}(x-\bar{x})^2\end{align*}
820 21\begin{align*}-21\end{align*} 441
900 59 3,481
810 31\begin{align*}-31\end{align*} 961
790 51\begin{align*}-51\end{align*} 2,601
810 31\begin{align*}-31\end{align*} 961
800 41\begin{align*}-41\end{align*} 1,681
850 9 81
820 21\begin{align*}-21\end{align*} 441
920 79 6,241
890 49 2,401

x¯s2s2=820+900+810+790+810+800+850+820+920+89010=8,41010=841=(xx¯)2n1=441+3,481+961+2,601+961+1,681+81+441+6,241+2,4019=19,29092,143.33¯¯¯¯¯\begin{align*}\bar{x}&=\frac{820+900+810+790+810+800+850+820+920+890}{10}=\frac{8,410}{10}=841\\ s^2 & = \frac{\sum (x-\bar{x})^2}{n-1}\\ s^2 & = \frac{441+3,481+961+2,601+961+1,681+81+441+6,241+2,401}{9} = \frac{19,290}{9} \approx 2,143.\overline{33}\end{align*}

The variance of the burning times for Brand B is approximately 2,143.33 hours. Therefore, Brand B has the more variable burning times.

### Review

1. The following data was collected: 589104375\begin{align*}5 \qquad 8 \qquad 9 \qquad 10 \qquad 4 \qquad 3 \qquad 7 \qquad 5\end{align*} Fill in the chart below and calculate the variance. The data represents a small population.
Data (x)\begin{align*}(x)\end{align*} Mean (μ)\begin{align*}(\mu)\end{align*} Data \begin{align*}-\end{align*} Mean (xμ)\begin{align*}(x - \mu)\end{align*} Square of Data \begin{align*}-\end{align*} Mean (xμ)2\begin{align*}(x-\mu)^2\end{align*}
\begin{align*}\sum\end{align*}
1. What would the variance have been for question 1 had the data set represented a sample instead of a small population?
2. The following data was collected. \begin{align*}11 \qquad 15 \qquad 16 \qquad 12 \qquad 19 \qquad 17 \qquad 14 \qquad 18 \qquad 15 \qquad 10\end{align*} Fill in the chart below and calculate the variance. The data represents a small population.
Data \begin{align*}(x)\end{align*} Mean \begin{align*}(\mu)\end{align*} Data \begin{align*}-\end{align*} Mean \begin{align*}(x - \mu)\end{align*} Square of Data \begin{align*}-\end{align*} Mean \begin{align*}(x-\mu)^2\end{align*}
\begin{align*}\sum\end{align*}
1. What would the variance have been for question 3 had the data set represented a sample instead of a small population?
2. The following data was collected. \begin{align*}55 \qquad 54 \qquad 48 \qquad 52 \qquad 69 \qquad 60 \qquad 47 \qquad 66 \qquad 50 \qquad 61\end{align*} Fill in the chart below and calculate the variance. The data represents a small population.
Data \begin{align*}(x)\end{align*} Mean \begin{align*}(\mu)\end{align*} Data \begin{align*}-\end{align*} Mean \begin{align*}(x - \mu)\end{align*} Square of Data \begin{align*}-\end{align*} Mean \begin{align*}(x-\mu)^2\end{align*}
\begin{align*}\sum\end{align*}
1. What would the variance have been for question 5 had the data set represented a sample instead of a small population?
1. The following data was collected: \begin{align*}26 \qquad 30 \qquad 20 \qquad 27 \qquad 23 \qquad 33 \qquad 19 \qquad 26\end{align*} Fill in the chart below and calculate the variance. The data represents a sample.
Data \begin{align*}(x)\end{align*} Mean \begin{align*}(\bar{x})\end{align*} Data \begin{align*}-\end{align*} Mean \begin{align*}(x - \bar{x})\end{align*} Square of Data \begin{align*}-\end{align*} Mean \begin{align*}(x-\bar{x})^2\end{align*}
\begin{align*}\sum\end{align*}
1. What would the variance have been for question 7 had the data set represented a small population instead of a sample?
1. The following data was collected: \begin{align*}85 \qquad 99 \qquad 89 \qquad 90 \qquad 104 \qquad 82 \qquad 95 \qquad 110\end{align*} Fill in the chart below and calculate the variance. The data represents a sample.
Data \begin{align*}(x)\end{align*} Mean \begin{align*}(\bar{x})\end{align*} Data \begin{align*}-\end{align*} Mean \begin{align*}(x - \bar{x})\end{align*} Square of Data \begin{align*}-\end{align*} Mean \begin{align*}(x-\bar{x})^2\end{align*}
\begin{align*}\sum\end{align*}
1. What would the variance have been for question 9 had the data set represented a small population instead of a sample?

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

### Vocabulary Language: English Spanish

TermDefinition
variance A measure of the spread of the data set equal to the mean of the squared variations of each data value from the mean of the data set.
absolute deviation The absolute deviation is the sum total of how different each number is from the mean.
deviation Deviation is a measure of the difference between a given value and the mean.
Mean The mean of a data set is the average of the data set. The mean is found by calculating the sum of the values in the data set and then dividing by the number of values in the data set.
mean absolute deviation The mean absolute deviation is an alternate measure of how spread out the data is. It involves finding the mean of the distance between each data value and the mean. While this method might seem more intuitive, in statistics it has been found to be too limited and is not commonly used.
Population In statistics, the population is the entire group of interest from which the sample is drawn.
Sample A sample is a specified part of a population, intended to represent the population as a whole.
Skew To skew a given set means to cause the trend of data to favor one end or the other
standard deviation The square root of the variance is the standard deviation. Standard deviation is one way to measure the spread of a set of data.