How to Find Standard Deviation And Variance

Posted by

Last updated on February 2nd, 2022

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. 

How to Find Variance And Standard Deviation of a Sample

  1. Write down your sample data set. If you have every data point in a population then use the second method.
    Sample data set: X1 = 17,  X2 = 15, X3 = 23,  X4 = 7,  X5 = 9, X6 = 13.

  2. Write down the sample variance formula. 
    S2 = ∑(Xi – X̄)2/ n-1
    S2 = Variance, Xi = term in dataset, X̄ = Sample Mean, ∑ = Sum, n = Sample size.

  3. 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.

  4. Subtract the mean from each data point
     X1 – X̄ = 17 – 14 = 3, X2 – X̄ = 15 – 14 = 1,  X3 – X̄ = 23 – 14 = 9
     X4 – X̄ = 7 – 14 = -7, X5 – X̄ = 9 – 14 = -5, X6 – X̄ = 13 – 14 = -1

  5. Square each results.
     32 = 9, 12 = 1, 92 = 81, (-7)2 = 49, (-5)2 = 25, (-1)2 = 1

  6. Sum the Sequared values. Example:  9 + 1 + 81 + 49 + 25 + 1 = 166.

  7. 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 = S2 = 166/6-1 = 33.2

  8. 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

  1. 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:
    X1 = 5,  X2 = 5, X3 = 8,  X4 = 12,  X5 = 15, X6 = 18.

  2. Write down the population variance formula. 
    σ2 = ∑(Xi – µ)2/ n
    σ2= popultion variance, Xi = term in dataset, µ = Popultion Mean, ∑ = Sum, n = the number of data points in the population

  3. Find the mean of the population
    mean = μ =  = 10.5

  4. Subtract the mean from each data point.
     X1 – µ = 5 – 10.5 = -5.5, X2 – µ = 5 – 10.5 = -5.5,  X3 – µ = 8 – 10.5 = -2.5
     X4 – µ = 12 – 10.5 = 1.5, X5 – µ = 15 – 10.5 = 4.5, X6 – µ = 18 – 10.5 = 7.5

  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

  6. 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

  7. Calculate the Standard Deviation. Standard Deviation is the square root of the Variance.
    σ = √ 24.25 = 4.92

Source: WikiHow