The Standard Deviation is a measure of how spread out numbers are and Variance is a measure of how spread out a data set is. It is useful when creating statistical models since the low variance can be a sign that you are overfitting your data. Follow these simple steps to Calculate Standard Deviation and Variance.

Standard Deviation is the **square root** of the **Variance**. To Calculate the variance follow these simple steps:

- Work out the Mean. Mean is simple average of the numbers.
- Then For Each Number: Substract the Mean and Square the result.
- Then work out the average of those squared differences.

There are two different ways to calculate **Variance** depending on your data set which can be either sample or population.

Contents

## How to Find Variance And Standard Deviation of a Sample

**Write down your sample data set.**If you have every data point in a population then use the second method.**Sample data set:**X_{1}= 17, X_{2}= 15, X_{3}= 23, X_{4}= 7, X_{5}= 9, X_{6}= 13.**Write down the sample variance formula.**

S^{2}= ∑(X_{i}– X̄)^{2}/ n-1

S^{2}= Variance, X_{i}= term in dataset, X̄ = Sample Mean, ∑ = Sum, n = Sample size.**Calculate the Sample Mean.**

First, add your data points together: 17 + 15 + 23 + 7 + 9 + 13 = 84

Next, divide your answer by the number of data points, in this case, six: 84 ÷ 6 = 14.**Sample mean = X̄ = 14**.**Subtract the mean from each data point**.

X_{1 }– X̄ = 17 – 14 = 3, X_{2 }– X̄ = 15 – 14 = 1, X_{3 }– X̄ = 23 – 14 = 9

X_{4 }– X̄ = 7 – 14 = -7, X_{5 }– X̄ = 9 – 14 = -5, X_{6 }– X̄ = 13 – 14 = -1**Square each results.**

3^{2}= 9, 1^{2}= 1, 9^{2}= 81, (-7)^{2}= 49, (-5)^{2}= 25, (-1)^{2}= 1**Sum the Sequared values.****Example:**9 + 1 + 81 + 49 + 25 + 1 =**166**.**Divide by n – 1, where n is the number of data points.**

There are six data points in the sample, so n = 6.

Variance of the sample = S^{2}= 166/6-1 = 33.2**Calculate the Standard Deviation.**Standard Deviation is the**square root**of the**Variance**.

S = √ 33.2 = 5.76

## How to Find Variance And Standard Deviation of a Population

**Write down your population data set.****Example:**There are exactly six fish tanks in a room of the aquarium. The six tanks contain the following numbers of fish:

X_{1}= 5, X_{2}= 5, X_{3}= 8, X_{4}= 12, X_{5}= 15, X_{6}= 18.**Write down the population variance formula.**σ^{2}= ∑(X_{i}– µ)^{2}/ n

σ^{2}= popultion variance, X_{i}= term in dataset, µ = Popultion Mean, ∑ = Sum, n = the number of data points in the population**Find the mean of the population**.

mean = μ = =**10.5**X**Subtract the mean from each data point.**_{1 }– µ = 5 – 10.5 = -5.5, X_{2 }– µ = 5 – 10.5 = -5.5, X_{3 }– µ = 8 – 10.5 = -2.5

X_{4 }– µ = 12 – 10.5 = 1.5, X_{5 }– µ = 15 – 10.5 = 4.5, X_{6 }– µ = 18 – 10.5 = 7.5**Square each answer.**(-5.5)^{2}= 30.25, (-5.5)^{2}= 30.25, (-2.5)^{2}= 6.25,

(1.5)^{2}= 2.25, (4.5)^{2}= 20.25, (7.5)^{2}= 56.25**Do the sum of the Squared values and Divide by n.**

Variance of the population(µ) =

30.25 + 30.25 + 6.25 + 2.25 + 20.25 + 56.25 / 6 = 145.5/6 = 24.25**Calculate the Standard Deviation.**Standard Deviation is the**square root**of the**Variance**.

σ = √ 24.25 = 4.92

**Source: **WikiHow