# What is variance and how to calculate it?

In statistics, the variance is widely used to find the actual distance of the data values from the average value. It is generally used to measure the relation of given observations with their expected value.

The variance is frequently used in various branches of mathematics and statistics. It is a well-known kind of statistics used to find the squared deviations. In this article, we’ll cover all the basics of variance and how to calculate it with examples.

## What is the variance?

A measure of how far a set of terms is spread out from the mean or measure of dispersion is known as the variance. In simple words, the square of the standard deviation gives the result of the variance.

There are two kinds of data sets in the variance, one is the sample data and the other is the population data. The population denotes the whole set of observations while if the number of population increases and is difficult to handle then the term sample data is used.

Sample data has some of the values from the whole observation. Both sample and population sets of data values find the actual distances.

## Kinds of variance

There are two kinds of variance.

- Sample variance
- Population variance

Let us discuss these types of variance briefly.

### 1. Population variance

In statistics, the term population variance is used to find the measure of the dispersion of the whole set of data values. This kind of variance finds the variance by dividing the sum of squared deviations by the total number of data observations.

Below is the general expression of this kind of variance.

**Population variance = σ ^{2} = **

**∑ (x**

_{i}– μ)^{2}/N**σ**= Denotes the population variance^{2}**N**= Total number of observations in a given data set.**x**= Data values._{i}**μ**= population mean- (x
_{i}– μ)^{2}= statistical sum of squares

### 2. Sample variance

In statistics, the term sample variance is used to find the measure of the dispersion of some data values from the whole set of data values. This kind of variance finds the variance by dividing the sum of squared deviations by the total number of data observations minus one.

Below is the general expression of this kind of variance

**Sample variance = s ^{2} = **

**∑ (x**

_{i}– x̅)^{2}/N – 1**s**= Denotes the sample variance^{2}**N**= Total number of observations in a given data set.**x**= Data values._{i}**x̅**= population mean- (x
_{i}–**x̅**)^{2}= statistical sum of squares

## How to calculate the variance?

The variance can be calculated easily by using the formulas of sample and population variances. Here are some examples of variance to learn how to calculate it. Follow the below steps to solve the problems of variance.

- First of all, calculate the sample or population mean of the given set of data observations.
- Calculate the difference of each data value from the mean.
- Take the square of each difference or deviation to make them positive.
- Calculate the sum of each squared deviation known as the statistical sum of squares.
- In the end, divide the statistical sum of squares by N for getting the result of population variance and by N – 1 for getting the result of sample variance.

**Example I: For sample variance **

Calculate the sample variance of 1, 5, 6, 10, 13, 17, 20, 24, 29, 35.

**Solution **

**Step 1:** First of all, find the sample mean of variance

Sum of sample values = 1 + 5 + 6 + 10 + 13 + 17 + 20 + 24 + 29 + 35

= 160

Total number of observation = n = 10

Sample mean of data set = x̅ = 160/10 = 80/5

= 16

**Step 2:** Now find the deviation.

x_{1} – x̅ = 1 – 16 = -15

x_{2} – x̅ = 5 – 16 = -11

x_{3} – x̅ = 6 – 16 = -10

x_{4} – x̅ = 10 – 16 = -6

x_{5} – x̅ = 13 – 16 = -3

x_{6} – x̅ = 17 – 16 = 1

x_{7} – x̅ = 20 – 16 = 4

x_{8} – x̅ = 24 – 16 = 8

x_{9} – x̅ = 29 – 16 = 13

x_{10} – x̅ = 35 – 16 = 19

**Step 3:** Determine the squares of the deviations to make all the entries positive.

(x_{1} – x̅)^{2} = (-15)^{2} = 225

(x_{2} – x̅)^{2} = (-11)^{2} = 121

(x_{3} – x̅)^{2} = (-10)^{2} = 100

(x_{4} – x̅)^{2} = (-6)^{2} = 36

(x_{5} – x̅)^{2} = (-3)^{2} = 9

(x_{6} – x̅)^{2} = (1)^{2} = 1

(x_{7} – x̅)^{2} = (4)^{2} = 16

(x_{8} – x̅)^{2} = (8)^{2} = 64

(x_{9} – x̅)^{2} = (13)^{2} = 169

(x_{9} – x̅)^{2} = (19)^{2} = 361

**Step 4:** Now calculate the statistical sum of squares.

∑ (x_{i} – x̅)^{2} = 225 + 121 + 100 + 36 + 9 + 1 + 16 + 64 + 169 + 361

∑ (x_{i} – x̅)^{2} = 1102

**Step 5:** Now divide the statistical sum of squares by N – 1.

∑ (x_{i} – x̅)^{2} / N – 1 = 1102 / 10 – 1

∑ (x_{i} – x̅)^{2} / N – 1 = 1102 / 9

∑ (x_{i} – x̅)^{2} / N – 1 = 122.444

To ease up the calculation of finding variance with steps use a variance calculator. Follow the below steps to use this calculator.

**Step I:** Select the type of data i.e., sample or population.

**Step II:** Enter the comma-separated values.

**Step III:** Click calculate button

**Example II: For population variance**

Calculate the population variance of 2, 5, 10, 15, 20, 25, 27, 28, 30, 34.

**Solution **

**Step 1:** First of all, find the population mean of variance.

Sum of population values = 2 + 5 + 10 + 15 + 20 + 25 + 27 + 28 + 30

= 162

Total number of observation = n = 9

Mean of population data set = μ = 162/9 = 54/3

= 18

**Step 2:** Now subtract the sample mean from all the given observations individually.

x_{1} – μ = 2 – 18 = -16

x_{2} – μ = 5 – 18 = -13

x_{3} – μ = 10 – 18 = -8

x_{4} – μ = 15 – 18 = -3

x_{5} – μ = 20 – 18 = 2

x_{6} – μ = 25 – 18 = 7

x_{7} – μ = 27 – 18 = 11

x_{8} – μ = 28 – 18 = 10

x_{9} – μ = 30 – 18 = 12

**Step-3:** Determine the squares of the deviations to make all the entries positive.

(x_{1} – μ)^{2} = (-16)^{2} = 256

(x_{2} – μ)^{2} = (-13)^{2} = 169

(x_{3} – μ)^{2} = (-8)^{2} = 64

(x_{4} – μ)^{2} = (-3)^{2} = 9

(x_{5} – μ)^{2} = (2)^{2} = 4

(x_{6} – μ)^{2} = (7)^{2} = 49

(x_{7} – μ)^{2} = (11)^{2} = 121

(x_{8} – μ)^{2} = (10)^{2} = 100

(x_{9} – μ)^{2} = (12)^{2} = 144

**Step 4:** Now calculate the summation of the statistical sum of squares.

∑ (x_{i} – μ)^{2} = 256 + 169 + 64 + 9 + 4 + 49 + 81 + 100 + 144

∑ (x_{i} – μ)^{2} = 876

**Step-5:** Now divide the above summation value by N.

∑ (x_{i} – μ)^{2} / N = 876 / 9

∑ (x_{i} – μ)^{2} / N = 292 / 3

∑ (x_{i} – μ)^{2} / N = 97.333

# Conclusion

In this post, we have covered all the basics of the variance along with solved examples. Now you are witnessed that variance is not a difficult topic. You can grab all the basics of sample and population variance from this post.