freeCodeCamp/guide/english/mathematics/calculating-standard-deviat.../index.md

1.6 KiB

title
Calculating Standard Deviation Step by Step

Calculating Standard Deviation Step by Step

Standard deviation is the measure of the average distance of all data points in a set to the mean of that set. The formula for the standard deviation of any given set is:

alt text

where n is the number of elements in the data set, xi is the ith element in the data set, and x̄ is the mean of the data set

As seen in the formula, you first take the difference of all the values in the data set from the mean, square all of the differences, sum up all the squares, then divide it all by the number of elements in the data set minus 1.

For example if you had a data set of [1,2,3] which has a mean of 2:

You first would find the difference of all the data points and the mean:

1-2 = -1 2-2 = 0 3-2 = 1

Next you square all the differences:

(-1)^2 = 1 (0)^2 = 0 (1)^2 = 1

Then you add all the squares together:

1+0+1 = 2

Finally you divide the sum by n-1, giving you the standard deviation:

2/2 = 1 --> Standard Deviation.

More Information:

IMAGE ALT TEXT HERE