Statistics Calculators
Standard Deviation Calculator


Standard Deviation Calculator

Given a discrete data set, the calculator calculates the mean, variance, and standard deviation of a sample or a population and shows all the intermediate steps of calculations.

Sample Population
Standard Deviation σ = 5.3385 s = 4.9937
Variance σ2 = 28.5 s2 = 24.9375
Count n = 8 n = 8
Mean μ = 18.25 x̄ = 18.25
Sum of Squares SS = 199.5 SS = 199.5

There was an error with your calculation.

Table of Contents

  1. The Standard Deviation
  2. The Population Standard Deviation
    1. Example of calculating the standard deviation of the general population
  3. The Sample Standard Deviation
  4. Margin of Error
  5. The Confidence Interval
    1. Example of confidence interval calculation

Standard Deviation Calculator

The standard deviation calculator calculates the standard deviation of a set of numbers. In addition, it provides additional information about the numbers, including the mean and the variance. The calculator also calculates the confidence interval of the dataset for different confidence levels and provides the frequency distribution table.

To use this calculator, enter the numbers into the calculator separated by commas. Select whether the numbers represent a population or a sample, and click "Calculate".

The Standard Deviation

The standard deviation is a statistical measure that defines the degree of spread or variability of a given data set. It provides the aggregated average distance of the data points from the mean of the dataset. The smaller the standard deviation, the closer the data points are to the mean. Conversely, the higher the standard deviation, the farther the data points are from the mean. The standard deviation is the square root of another measure of spread called the variance.

The standard deviation is calculated based on the information about the data set. If the dataset represents all the data points of interest (population), the standard deviation is called the population standard deviation. However, if the dataset represents a sample from a population, the standard deviation is called a sample standard deviation.

The Population Standard Deviation

The population standard deviation is calculated when the dataset represents the population of interest. That is, the dataset represents all the observations under consideration. The population standard deviation is denoted by σ.

σ is the lowercase of a Greek letter called Sigma. The population standard deviation is calculated using the formula:

$$\sigma=\sqrt{\frac{\sum_{i=1}^{N}{(x_i-\mu)^2}}{N}}$$

Where:

  • Σ is the Greek capital letter Sigma, which is used to denote summation in mathematics;
  • xᵢ represents each of the data points (each observation of the data set), starting from the first data point to the Nth (the last) data point;
  • μ represents the population mean;
  • n is the population size.

Example of calculating the standard deviation of the general population

The following example shows how to find the standard deviation of population data.

Investors consider stocks a risky asset because of their high volatility compared to other classes of assets. An investment manager wants to analyze the volatility of some stocks in the previous month and will not recommend to his clients any stock whose standard deviation is greater than or equal to its mean since he considers such a stock "too risky."

Listed below are all the daily closing prices (in USD) of stocks for the previous month. Calculate the standard deviation and determine whether the manager considers the stock "too risky":

1.31, 1.30, 1.36, 1.40, 1.40, 1.41, 1.27, 1.19, 1.15, 1.12, 0.99, 1.00, 0.97, 0.94, 0.88, 0.90, 0.86, 0.88, 0.80, 0.81

Note that the manager is only interested in the stock prices of the previous month, and the prices listed above are all the prices of the previous month. Consequently, we have the population at our disposal. So we will calculate the standard deviation using the formula for the standard deviation of the population.

To find the standard deviation, first calculate the mean. Remember that the mean μ is obtained by dividing the sum of the numbers by the count of the numbers.

$$\mu=\frac{1.31+1.30+1.36+1.40+1.40+1.41+1.27+1.19+1.15+1.12+0.99+1.00+0.97+0.94+0.88+0.90+0.86+0.88+0.80+0.81}{20}=1.097$$

Next, subtract the mean from each number and square the difference. Then add the results and divide the result by the count. The result is called the variance σ².

$$\sigma^2=\frac{\left(1.31-1.097\right)^2+\left(1.30-1.097\right)^2+\left(1.36-1.097\right)^2+\left(1.40-1.097\right)^2+\ldots+\left(0.81-1.097\right)^2}{20}=0.045031$$

Finally, take the square root of the variance to get the standard deviation.

$$\sigma=\sqrt{0.045031}\approx0.21$$

As you can see, the standard deviation of the prices of this stock for the previous month is less than the mean. Hence, the manager will not consider this stock "too risky."

The Sample Standard Deviation

The sample standard deviation is calculated when the dataset under consideration represents a sample from the population of interest. The dataset represents a smaller set of observations from all the observations under consideration. The sample standard deviation is denoted by s. The sample standard deviation is calculated using the formula:

$$s=\sqrt{\frac{\sum_{i=1}^{n}\left(x_i-\bar{x}\right)^2}{n-1}}$$

Where:

  • Σ denotes summation;
  • xᵢ represents each of the data points;
  • represents the sample mean;
  • n is the sample size.

We will illustrate how to find the standard deviation of sample data using the same example as for the standard deviation of the population. But in this situation, the investment manager does not have access to the closing prices of all trading days of the previous month. However, he has the closing prices of some random 5 days of the previous month. Consequently, he will estimate the standard deviation of stock closing prices using data from the available sample.

Let us assume that he has the closing prices for 5 days:

1.31, 1.40, 0.86, 0.88, 1.40

Note that the manager is interested in the previous month's stock prices. However, he does not have all the prices of the previous month, but a small subset of the closing prices of only 5 days. So in this case we are dealing with a sample. We will calculate the standard deviation using the sample standard deviation formula.

First, calculate the mean of the sample.

$$\bar{x}=\frac{1.31+1.40+0.86+0.88+1.40}{5}=1.17$$

Next, calculate the variance .

$$s^2=\frac{\left(1.31-1.17\right)^2+\left(1.40-1.17\right)^2+\left(0.86-1.17\right)^2+\left(0.88-1.17\right)^2+\left(1.40-1.17\right)^2}{5-1}=0.0764$$

Finally, take the square root of the variance to get the standard deviation.

$$s=\sqrt{0.0764}\approx 0.28$$

Margin of Error

One of the uses of the standard deviation is to calculate the "acceptable" range of values. This plays a significant role in industry statistical quality assurance and predictive analysis. Suppose the underlying data under consideration follows a normal distribution. In that case, this range is referred to as the confidence interval (refer to the next section). These confidence intervals are given at various confidence levels (or percentages).

The margin of error is a component of the confidence interval that gives the confidence interval width. That is, the margin of error gives the maximum and the minimum accepted values of the quantity under consideration.

The margin of error is calculated using the formula:

$$Margin\ of\ error\ = z_{\alpha/2}\left(\dfrac{\sigma}{\sqrt{n}}\right)$$

We apply this formula if the population standard deviation, σ, is known. And at the same time the sample should be sufficiently large (usually n>30).

When the population standart deviation is unknown and the sample is small (usually n≤30) we use the following formula:

$$Margin\ of\ error\ = t_{n-1,\alpha/2}\left(\frac{s}{\sqrt{n}}\right)$$

In this formula we use the sample standard deviation s as the population standard deviation σ is not known.

\$z_{\alpha/2}\$ and \$t_{n-1, \alpha/2}\$ are determined using z-statistics and t-statistics, respectively, and are called the critical value. They are constants associated with confidence levels.

The most common confidence intervals used in statistics are 90%, 95%, and 99%. And their \$z_{\alpha/2}\$ values are 1.645 (for 90%), 1.96 (for 95%), and 2.575 (for 99%)

\$\frac{\sigma}{\sqrt n}\$ or \$\frac{s}{\sqrt n}\$ are called the standard error.

  • \$\frac{\sigma}{\sqrt n}\$ is used when we know the standard deviation of the population σ and we have a large sample (usually n>30).
  • \$\frac{s}{\sqrt n}\$ is used for cases where we do not know the standard deviation of the population and we have a small sample (usually n≤30). That is, instead of the standard deviation of the general population σ, we have to use the standard deviation of the sample available to us s.

The Confidence Interval

As introduced above, the confidence interval is an interval (range of values) in which a given quantity is expected to lie at a certain confidence level.

For instance, we can say that a certain amount, say the height of 13-year-old girls, lies between 59 ins and 66 inches at a 90% confidence level. That is, if we are to select a group of 13-year-old girls, about 90% of the time, their heights will lie between the given values.

The confidence interval is calculated using the formula:

$$\bar{x}± z_{\alpha/2}\left(\frac{\sigma}{\sqrt{n}}\right)$$

  • is the sample mean,
  • \$z_{\alpha/2}\$ is the critical value,
  • σ is population standard deviation,
  • n is the number of observations.

Another formula is used when we do not know the population standard deviation σ and we have to use sample standard deviation s instead:

$$\bar{x}± t_{n-1,\alpha/2}\left(\frac{s}{\sqrt{n}}\right)$$

  • is the sample mean,
  • \$t_{n-1,\alpha/2}\$ is the critical value,
  • s is sample standard deviation,
  • n is the number of observations.

As we can remember from the previous chapter \$z_{\alpha/2}\left(\frac{\sigma}{\sqrt{n}}\right)\$ and \$t_{n-1,\alpha/2}\left(\frac{s}{\sqrt{n}}\right)\$ are the margins of error.

Example of confidence interval calculation

Suppose we know that the daily stock prices we are considering have a normal distribution. We have a sample of stock prices at our disposal:

1.31, 1.36, 1.40, 1.27, 1.15, 0.99, 0.97, 0.88, 0.86, 0.80

We need to calculate in what range stock prices will fluctuate with 95% confidence.

This is a small sample and we do not know the population standard deviation, so we will use the sample standard deviation and the formula to calculate:

$$\bar{x}± t_{n-1,\alpha/2}\left(\frac{s}{\sqrt{n}}\right)$$

  • is the sample mean, 1.10
  • \$t_{n-1,\alpha/2}\$ is the critical value, \$t_{9, 0.025}\$ = 2.26 (the critical value for a given sample size and confidence level is usually calculated from a z-table or t-table)
  • s is the sample standard deviation, 0.23
  • n is the number of observations, 10,
  • \$\frac{s}{\sqrt n}\$ is the standard error \$\frac{0.23}{\sqrt{10}}=0.07\$

So we put the numbers into the formula

$$\bar{x}± t_{n-1,\alpha/2}\left(\frac{s}{\sqrt{n}}\right)$$

and we get:

$$1.10 - 2.26 (\frac{0.23}{\sqrt{10}}) = 1.10 - 2.26 (\frac{0.23}{3.16}) = 1.10 - 2.26 × 0.07 = 1.10 - 0.16 = 0.94$$

$$1.10 + 2.26 (\frac{0.23}{\sqrt{10}}) = 1.10 + 2.26 (\frac{0.23}{3.16}) = 1.10 + 2.26 × 0.07 = 1.10 + 0.16 = 1.26$$

This means that we are 95% sure that the average share price lies in the confidence interval (0.94, 1.26).