Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Statistics formulas

Sample variance and standard deviation

Estimate population spread from a sample.

  • Statistics
  • Spread
  • High school · AP · University
Statistics · Spread
$$s^2=\frac1{n-1}\sum(x_i-\bar{x})^2,\qquad s=\sqrt{s^2}$$

Sample variance and standard deviation is one of 3 spread formulas in the statistics section of this library, and it is used at high school · ap · university level.

Why sample variance and standard deviation works

The sample mean is pulled toward whatever values happen to be in the sample, so the data always cluster a little more tightly around it than around the true population mean. Dividing by n minus 1 instead of n scales the answer up by just enough to undo that built-in shrinkage.

What each symbol means

$n$ is sample size and $\bar x$ sample mean.

Sample variance and standard deviation: when it holds

$n>1$; $n-1$ corrects degrees of freedom after estimating the mean.

When it stops applying

The n minus 1 correction is right only because the mean was estimated from the same data. If the population mean is genuinely known, you should measure deviations from it and divide by n, and with a sample of size 1 the formula gives zero divided by zero and no answer exists at all.

Sample variance and standard deviation: a worked example

For sample $1,3$, $\bar x=2$, $s^2=2$, and $s=\sqrt2$.

The mistake to avoid

What people do: Pressing the population key on the calculator when the question describes a sample.

Why it goes wrong: For the eight values 2, 4, 4, 4, 5, 5, 7, 9 the population key gives exactly 2 while the sample key gives about 2.138. That is a 7 percent difference in every answer built on it.

Do this instead: Read the question for the words sample and population, then choose the key labelled s or the one labelled sigma to match.

Sample variance and standard deviation: step by step

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $n$ is sample size and $\bar x$ sample mean.
  3. Check the conditions before substituting. $n>1$; $n-1$ corrects degrees of freedom after estimating the mean.
  4. Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most statistics slips.

Where this formula fits

Subject
Statistics formulas — 21 entries in this library
Topic
Spread
Level
High school · AP · University

Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where sample variance and standard deviation comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.

Questions about sample variance and standard deviation

Why is s always larger than the population formula on the same numbers?

Because the same total is divided by a smaller number. The ratio is the square root of n over n minus 1, which for eight observations is about 1.069, and it shrinks toward 1 as the sample grows.

What does the phrase degrees of freedom mean here?

Once the mean is fixed, the last deviation is forced by the others, since all n deviations must add to zero. Only n minus 1 of them are free to vary, so that is the divisor.

Is s an unbiased estimate of the population standard deviation?

The squared version is unbiased, but the square root is not quite; s runs slightly low on average. The bias is small and shrinks with sample size, so it is ignored in almost every course.

What happens when I have only one observation?

You get no answer, and correctly so. A single value carries no information about spread at all, and the formula makes that honest by producing zero divided by zero.

Stuck on a problem?

Work a sample variance and standard deviation problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.