In statistics, the variance is frequently used to calculate the variation in the given data values depending upon the nature of the set of data values. It is used in many fields of statistics to measure the spread of data sets.

The square root of this term will give the result of the standard deviation. The standard deviation is more accurate than this subtype of statistics. In this lesson, we will understand how to calculate the problems of the variance and define this subtype manually.

## What is the variance?

The term variance is widely used in statistics and is defined as the measure of the spread of data values from the average value of the data values. It is also defined as the average of the squared deviations from the whole set of data values.

It measures the spread of population/sample data values from the expected values of the population/sample. The square of the standard deviation will also give the result of the variance as the variance is the square of the standard deviation.

The smaller variance indicated that the spread of data values is closer to the expected values while the larger value of the variance indicates that the values are spread away from the mean.

## Kinds of the variance

There are two basic types of variance on the basis of the nature of data values.

- Sample variance
- Population variance

Let us briefly describe the above-mentioned types of variance along with examples.

### Population variance

The population data set is indicating to the whole set of observations as the population is taken from all the objects or things such as the number of boys in a village. The population variance is the measure of the spread (variation) of observations from the average value of the population set.

- The population variance can be measured by calculating the deviation (difference of observations from the mean).
- Then take the square of the deviations to make all the differences positive as the variance is always positive.
- After calculating the square of the deviations, add all the squared terms.
- Divide the sum of squares by the total number of population observations.

The general expression of the population variance is:

**σ ^{2} = [∑ (z_{i} – μ)^{2}/N]**

Use this formula to calculate the population variance of the given data set manually.

**Example**

Measure the spread of the given data values to calculate the population variance.

1, 3, 7, 11, 15, 17, 21, 23, 25, 32

**Solution **

**Step 1:** First of all, take the given set of population data and calculate the average of the given set of observations.

Sum = 1 + 3 + 7 + 11 + 15 + 17 + 21 + 23 + 25 + 32

Sum = 155

Total number of observation = N = 10

Population Mean = µ = 155/10 = 31/2

Population Mean = µ = 15.5

**Step 2:** Now calculate the difference of data values from the mean and take the square of the differences to make them positive.

Data values |
z_{i} – µ |
(z_{i} – µ)^{2} |

1 | 1 – 15.5 = -14.5 | (-14.5)^{2} = 210.25 |

3 | 3 – 15.5 = -12.5 | (-12.5)^{2} = 156.25 |

7 | 7 – 15.5 = -8.5 | (-8.5)^{2} = 72.25 |

11 | 11 – 15.5 = -4.5 | (-4.5)^{2} = 20.25 |

15 | 15 – 15.5 = -0.5 | (-0.5)^{2} = 0.25 |

17 | 17 – 15.5 = 1.5 | (1.5)^{2} = 2.25 |

21 | 21 – 15.5 = 5.5 | (5.5)^{2} = 30.25 |

23 | 23 – 15.5 = 7.5 | (7.5)^{2} = 56.25 |

25 | 25 – 15.5 = 9.5 | (9.5)^{2} = 90.25 |

32 | 32 – 15.5 = 16.5 | (16.5)^{2} = 272.25 |

**Step 3:** Now add the squared deviations to calculate the sum of squares.

∑ (z_{i} – µ)^{2} = 210.25 + 156.25 + 72.25 + 20.25 + 0.25 + 2.25 + 30.25 + 56.25 + 90.25 + 272.25

∑ (z_{i} – µ)^{2} = 910.5

**Step 4:** Now take the quotient of the sum of squared differences and the total number of observations. This will give you the result of the variance.

∑ (z_{i} – µ)^{2} / N = 910.5 / 10

∑ (z_{i} – µ)^{2} / N = 182.1 / 2

∑ (z_{i} – µ)^{2} / N = 91.05

Cross check the above result of the population variance with the help of a variance calculator.

### Sample variance

The sample data set is indicating to the sample values from the whole set of observations as the sample is taken from the whole population to make the calculations easier by taking the approximate estimations by taking the sample data.

The sample variance is the measure of the spread (variation) of observations from the average value of the sample set.

- The sample variance can be measured by calculating the deviation (difference of observations from the mean).
- Then take the square of the deviations to make all the differences positive as the variance is always positive.
- After calculating the square of the deviations, add all the squared terms.
- Divide the sum of squares by the total number of population observations.

The general expression of the sample variance is:

**s ^{2} = [∑ (z_{i} – z̄)^{2}/N]**

Use this formula to calculate the population variance of the given data set manually.

**Example**

Measure the spread of the given data values to calculate the sample variance.

12, 11, 1,9 16, 18, 21, 22, 23, 28, 29, 38

**Solution **

**Step 1:** First of all, calculate the sample mean of the given data values.

Sum = 12 + 11 + 1 + 9 + 16 + 18 + 21 + 22 + 23 + 28 + 29 + 38

Sum = 228

Total number of observation = N = 12

Sample Mean = z̄ = 228/12 = 114/6 = 57/3

Sample Mean = z̄ = 19

**Step 2:** Now calculate the difference of data values from the mean and take the square of the differences to make them positive.

Data values |
z_{i} – z̄ |
(z_{i} – z̄)^{2} |

12 | 12 – 19 = -7 | (-7)^{2} = 49 |

11 | 11 – 19 = -8 | (-8)^{2} = 64 |

1 | 1 – 19 = -18 | (-18)^{2} = 324 |

9 | 9 – 19 = -10 | (-10)^{2} = 100 |

16 | 16 – 19 = -3 | (-2)^{2} = 4 |

18 | 18 – 19 = -1 | (-1)^{2} = 1 |

21 | 21 – 19 = 2 | (2)^{2} = 4 |

22 | 22 – 19 = 3 | (3)^{2} = 9 |

23 | 23 – 19 = 4 | (4)^{2} = 16 |

28 | 28 – 19 = 9 | (9)^{2} = 81 |

29 | 29 – 19 = 10 | (10)^{2} = 100 |

38 | 38 – 19 = 19 | (19)^{2} = 361 |

**Step 3:** Now add all the squared differences.

∑ (z_{i} – z̄)^{2} = 49 + 64 + 324 + 100 + 9 + 1 + 4 + 9 + 16 + 81 + 100 + 361

∑ (z_{i} – z̄)^{2} = 1118

**Step 4:** Now take the quotient of the sum of squared differences and the total number of observations decreased by one. This will give you the result of the variance.

∑ (z_{i} – z̄)^{2} / N – 1 = 1118 / 12 – 1

∑ (z_{i} – z̄)^{2} / N – 1 = 1118 / 11

∑ (z_{i} – z̄)^{2} / N – 1 = 101.64

## Wrap up

Now you can get all the basics of the variance from this post. In this post, we have covered all the basics that are necessary to solve the problems of variance with definitions, types, formulas, and solved examples.