Expand menu menu_open Minimize Start chapters Home History history History expand_more
{{ item.displayTitle }}
No history yet!
Progress & Statistics equalizer Progress expand_more
{{ filterOption.label }}
{{ item.displayTitle }}
{{ item.subject.displayTitle }}
No results
{{ searchError }}
{{ courseTrack.displayTitle }}
{{ statistics.percent }}% Sign in to view progress
{{ printedBook.courseTrack.name }} {{ printedBook.name }}
search Use offline Tools apps
Login account_circle menu_open

Calculating Mean and Standard Deviation


Numerical Data

Numerical data is data that is measurable, such as time, speed and distance. It is described with numbers that can be either discrete or continuous. When the data is continuous, in theory, there are infinitely many possibilities.

Measure of Center

A measure of center is a statistic that summarize a data set by finding its center. The most common measures of center are mean, median and mode.


The mean or average of a data set is one representation of the center of the data set. It is one measure of center. The others are the median and the mode. To calculate the mean, add all the data points together, then divide by the number of data points.

mean =sum of valuesnumber of values=\dfrac{\text{sum of values}}{\text{number of values}}

Suppose a data set represents the heights of different towers. The mean of this data set gives an idea of a typical height. Calculating the mean could be seen as rearragning the blocks so that all the towers have the same height.

Animate the mean value


After the blocks are rearranged, the towers each have a height of 4.4. Therefore, the mean is 4.4. If the heights are written as xx, then the mean is sometimes written as xˉ.\bar{x}. The towers' mean height can then be written as xˉ=4.\bar{x}=4.


When on vacation in Mexico, Peter finds a rose species he has never seen before. He decides to study how many petals each flower has. The result of his study is this. 10,  14,  11,  9,  16 10,\; 14,\; 11,\; 9,\; 16 How many petals do the flowers on average have?

Show Solution
In order to determine the mean, we need to add all the data points together. Then we divide the sum by the total number of points, which in this case is 5.5.
xˉ=10+14+11+9+165\bar{x} = \dfrac{10 + 14 + 11 + 9 + 16}{5}
xˉ=605\bar{x} = \dfrac{60}{5}
xˉ=12\bar{x} = 12
The mean is 12.12. Thus, on average the roses have 1212 petals each.

Measure of Spread

A measure of spread is a way of quantifying how spread out, or different, the points in a data set are. A small spread means data points are similar, while a large spread means they are different. This is illustrated by the two data sets below. Both have a mean, median and mode of 3,3, but, we can assume the second data set has a larger spread because of how different its data points are.

Some commonly used measures of spread are range, mean absolute deviation, standard deviation, and interquartile range. These are often used together with a measure of center, to give an idea both of what a typical value is and how much the data can be expected to deviate from it.

Standard Deviation

Standard deviation is a commonly used measure of spread. It is a measure of how much a randomly selected value from a data set is expected to differ from the mean. To denote the standard deviation, the Greek letter σ\sigma is used, which is read as "sigma."To calculate a standard deviation, the rule σ=(x1xˉ)2+(x2xˉ)2++(xnxˉ)2n \sigma = \sqrt{ \dfrac{ (x_1 - \bar{x})^2 + (x_2 - \bar{x})^2 + \ldots + (x_n - \bar{x})^2}{n} } is used, where nn is the number of values in the data set and xˉ\bar{x} is the mean of the set.


Finding the Standard Deviation of a Data Set

The standard deviation, σ,\sigma, of a data set is calculated using the rule σ=(x1xˉ)2+(x2xˉ)2++(xnxˉ)2n, \sigma = \sqrt{ \dfrac{ (x_1 - \bar{x})^2 + (x_2 - \bar{x})^2 + \ldots + (x_n - \bar{x})^2}{n} }, where nn is the number of values in the data set and xˉ\bar{x} is the mean of the set. Performing this calculation in one step makes for a convoluted expression. Therefore, it is best divided into a few, smaller steps. Consider the following data set as an example. 1,5,3,8,3,12 1, 5, 3, 8, 3, 12


Find the mean, xˉ\bar{x}

First, the mean, xˉ,\bar{x}, should be calculated. The example data set has 66 values, so the denominator is 6.6.

xˉ=1+5+3+8+3+126\bar{x} = \dfrac{1 + 5 + 3 + 8 + 3 + 12}{6}
xˉ=326\bar{x} = \dfrac{32}{6}
xˉ=4\bar{x} = 4


Find the deviation of each data value, xxˉx - \bar{x}

For each data value, xxˉx - \bar{x} can now be calculated and added to a table. This shows how much each data point varies from the mean.

xx xxˉx - \bar{x}
11 14=-31 - 4 = \text{-} 3
55 54=15 - 4 = 1
33 34=-13 - 4 = \text{-} 1
88 84=48 - 4 = 4
33 34=-13 - 4 = \text{-} 1
1212 124=812 - 4 = 8


Square the deviations

Square the deviations, and add them to a new column in the table.

xx xxˉx - \bar{x} (xxˉ)2(x - \bar{x})^2
11 -3\text{-} 3 (-3)2=9(\text{-} 3)^2 = 9
55 11 12=11^2 = 1
33 -1\text{-} 1 (-1)2=1(\text{-} 1)^2 = 1
88 44 42=164^2 = 16
33 -1\text{-} 1 (-1)2=1(\text{-} 1)^2 = 1
1212 88 82=648^2 = 64


Find the mean of the squared deviations

The squared deviations should be added and divided by the number of data values. In other words, the mean of the squared deviations is found.

9+1+1+16+1+646\dfrac{9 + 1 + 1 + 16 + 1 + 64}{6}
15.3333315.33333 \ldots

This value is called the variance of the data set.


Square-root the mean of the squared deviations

Finally, take the square root of the just found quotient to get the standard deviation. Here, the fraction is used instead of the quotient, to avoid rounding errors. σ=9263.92 \sigma = \sqrt{ \dfrac{92}{6} } \approx 3.92 Thus, a randomly chosen value from this data set is expected to deviate roughly 44 units from the mean.

{{ 'mldesktop-placeholder-grade-tab' | message }}
{{ 'mldesktop-placeholder-grade' | message }} {{ article.displayTitle }}!
{{ grade.displayTitle }}
{{ exercise.headTitle }}
{{ 'ml-tooltip-premium-exercise' | message }}
{{ 'ml-tooltip-programming-exercise' | message }} {{ 'course' | message }} {{ exercise.course }}
{{ 'ml-heading-exercise' | message }} {{ focusmode.exercise.exerciseName }}
{{ 'ml-btn-previous-exercise' | message }} arrow_back {{ 'ml-btn-next-exercise' | message }} arrow_forward