FAQ - Math

How to Calculate Standard Deviation

How to Calculate Standard Deviation

What is Standard Deviation?

Standard deviation is a measure used in calculating the dispersion of a data set. It tells you just how much of your data is spread around the mean. A high standard deviation means the data points are more spread out from the average, while a low standard deviation means the points are closer to the mean. In statistics, standard deviation is often marked as σ.

How is Calculating Standard Deviation Applied? 

To understand how this might be applied in real-life settings, consider two different companies—each with six employees.

  1. In the first company, three employees earn $22, and another three earn $26 an hour.

  2. In the second company, one employee earns $32 an hour, two earn $30 an hour, the fourth earns $20 an hour, the fifth earns $17, and the last earn $15 an hour.


In both companies, the average pay is $24. But in the second company, the pay range is more spread out. As a result, the calculated standard deviation for wage values in the second company will be higher. For other general examples, statisticians may use it to analyze the reliability of a weather report or when  examining states with the largest pay gap.



Calculating Standard Deviation 

There are two types of standard deviations: population standard deviation and sample standard deviation. Both measure the degree of dispersion in a set. But while the population calculates all the values in a data set, the sample standard deviation calculates values that are only a part of the total data set. 


For instance, if a college teacher tries to summarize the results of a class exam using standard deviation, the population standard deviation is used, because it calculates the scores of all the students. But if a researcher is measuring the results of a customer survey, the sample standard deviation is used, because it involves data from only a portion of customers. 


The process of calculating either is almost identical. 


  1. Calculate the mean value of the data

  2. Subtract the mean from each data point. 

  3. Square the results of each value and then add all together 

  4. This step is where the population standard deviation differs slightly from the sample deviation. To calculate the population standard deviation, we divide the sum by the number of data points (N). But to calculate the sample deviation, the total is divided by the number of data points minus 1 (N-1). 

  5. Find the square root of the final figure to determine the standard deviation.


These steps are in the formulas:

Figure 1. Population Standard Deviation


Figure 2 Sample Standard Deviation

Where 

  • σ = Standard deviation

  • μ = The average of the data

  • N = The number of data points 

  • X = The value of the data

Example:

Find the standard deviation for {4, 7, 7, 8, 10, 12, 15, 17}


Step 1: Solve for the mean (μ)
The mean is the sum of all the numbers divided by the number of units. 

4 +7 + 7 + 8 +10 + 12 + 15 + 17 = 80

80/8 = 10

μ = 10

Step2. Solve for [X- μ]2

Subtract the mean from each of the numbers and find the square of the result [X- μ]2

X

4

7

7

8

10

12

15

17

Μ

10

10

10

10

10

10

10

10

X- μ

-6

-3

-3

-2

0

2

5

7

[X- μ]2

36

9

9

4

0

4

25

49


Step 3. Solve for ∑ [X- μ]2

Add the results from the previous step. 

[X- μ]2

36

9

9

4

0

4

25

49

 

36 + 9 + 9 +4 + 0 + 4 + 25 + 49 = 136


Step 4. Solve for ∑ [X- μ]2/N

Divide the answer by N, which is the number of data points (eight in this case). 


∑ [X- μ]2 = 136

N = 8

136/8 = 17

Step 5. Find the Square Root

To find the standard deviation, find the square root of the result (step 4) using:


The square root of 17 is 4.124

Thus, the standard deviation for {4, 7, 7, 8, 10, 12, 15,17} = 4.124


How to Calculate Standard Deviation for Grouped Data

Standard deviation is calculated differently with grouped data by using:

or


Both formulas work, but the second formula is sometimes easier and works by: 

  1. Finding the midpoint of each group (x)

  2. Multiplying the midpoint by the frequency of each class (f)

  3. Adding the resulting values 

  4. Dividing the sum by the total number of data points to get the mean μ

  5. Finding the square of all the midpoint values in (1)

  6. Multiplying the square of each range by the frequency and sum all the results

  7. Dividing the total of summed results by the total number of values

  8. Subtracting the square of the mean from the results of the previous step to find the variance

  9. Calculating the square root of the variance to find the standard deviation


Example:

Find the standard deviation of the following:


Marks

Frequency (f)

0 – 20

8

20 – 40

24

40 - 60 

28

60 – 80

29

80 – 100

11


Step 1.
Find the number of data points by adding up all the frequencies.

Marks

Frequency

0 – 20

8

20 – 40

24

40 - 60 

28

60 – 80

29

80 – 100

11


100


Step 2.

Find the mid interval value (x) for the different ranges by adding the top and bottom digit and divide by two (e.g. the mid-point of 80 to 100 is (80 + 100)/2 = 90). 

Marks

Frequency (f)

x

0 - 20

8

10

20 - 40

24

30

40 - 60 

28

50

60 – 80

29

70

80 - 100

11

90


100



Step 3. 

Multiply the midpoint-value by the corresponding frequency to find the sum of a range. Sum all the results. 

Marks

Frequency (f)

Midpoint (x)

fx

0 - 20

8

10

80

20 - 40

24

30

720

40 - 60 

28

50

1400

60 – 80

29

70

2030

80 - 100

11

90

990


100


5220


Step 4. 

Calculate the estimated average by dividing the sum in step 3 by the total number of data points.


5220/100 = 52.20

Step 5. 

Calculate the square of all the mid-interval values and sum them. 


Marks

Frequency (f)

Midpoint (X)

fx

X2

0 - 20

8

10

80

100

20 - 40

24

30

720

900

40 - 60 

28

50

1400

2500

60 – 80

29

70

2030

4900

80 - 100

11

90

990

8100


100


5220

16500


Step 6. 

Multiply the frequency (f) of each interval range by the square of the midpoint value (X) and sum up the total to find the sum of the squares (∑fX2). 


Marks

Frequency (f)

Midpoint (X)

fx

X2

fX2

0 - 20

8

10

80

100

800

20 - 40

24

30

720

900

21600

40 - 60 

28

50

1400

2500

70000

60 – 80

29

70

2030

4900

142,100

80 - 100

11

90

990

8100

89,100


100


5220


323,600


Step 7. 

Solve to find the estimated mean square by dividing the total of the squares found in step 6 by the total number of data points.


 (∑fX2)/n = 323,600/100 = 3,236

Step 8. 

Find the variance by subtracting the square of the mean in step 4 from the result in step 7.

Mean = 52.20

Square of the mean = 52.202 = 2,724.84

Mean Square - Square of the mean = 3,236 – 2,724.84 = 511.16

Variance = 511.16

Step 9. Solve for the Standard Deviation

At this point, simply find the square root of the variance. 

Sqrt of Var = √511.16 = 22.61

Standard Deviation for Group set is 22.61

How to Calculate Standard Deviation Using a Calculator

To solve standard deviation problems easily, choose a scientific calculator that offers this function. Most scientific calculators work with the same series of steps. 

  • Switch the calculator to statistics mode (STAT). 

  • Key in the values of the data set. 

  • Once you have all the values keyed in, press the standard deviation button.







More Articles to Read

Education

When teachers quit for other jobs, how is life outside of the classroom?

Heytutor Support
Heytutor Support
Updated April 24, 2024
Education

States with the highest rates of teacher attrition

Heytutor Support
Heytutor Support
Updated April 24, 2024