Sample Variance Explained with Worked Examples

The sample (unbiased) variance is , where .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Sample (unbiased) variance means

When the data is a sample from a larger population, dividing by tends to underestimate the population variance. Dividing by corrects this bias, which is why is called the unbiased estimator.

First find , the sum of squared deviations from the mean. A convenient way is .

The sample standard deviation is . Calculators usually give both versions. The population version is in mean, variance and standard deviation, it is used in the one-sample t statistic and the confidence interval for a mean, and coding of data shows how it scales.

This page is part of Averages and spread in Statistics. Topics that work alongside it: Mean, variance and standard deviation, One-sample t statistic, Confidence interval for a mean (σ unknown), Coding of data, Estimated mean of grouped data and Mean.

What is it used for?

The sample (unbiased) variance divides by n − 1 instead of n. It gives a better estimate of the population variance from a sample.

How to use sample (unbiased) variance

  1. Find and .
  2. Calculate .
  3. Divide by .
  4. Take the square root for .

Graph

Squared deviations of 3, 5, 7 from the mean 5: 4, 0, 4(3 − 5)² = 4(7 − 5)² = 400.511.522.533.54012345Squared deviations of 3, 5, 7 from the mean 5: 4, 0, 4itemyGraph with x from 0 to 4 and y from 0 to 5. Shows bars (3); point (3 − 5)² = 4 at (1, 4); point (7 − 5)² = 4 at (3, 4).

Their sum 8 divided by n − 1 = 2 gives the sample variance 4.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: find the sample variance

Find the sample variance of 1, 2, 3, 4, 5.

Worked example
Answer
s2=2.5s^{2}=2.5
  1. Sums
  2. S_xx
  3. Divide by n − 1

Example 2: compare with the population variance

Find the population variance of the same data and compare.

Worked example
Answer
σ2=2\sigma^{2}=2
  1. Divide by n
  2. Compare
    The sample variance 2.5 is larger than the population variance 2.

Example 3: 2, 4, 6

Find the sample variance of 2, 4, 6.

Worked example
Answer
44
  1. Mean
  2. Sum of squared deviations
  3. Divide by n − 1 = 2

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

2, 4, 6, 8

Sxx = 120 − 20²/4

20.

same

s² = Sxx/(n − 1)

6.6667.

1, 2, 3, 4, 5

s²

2.5.

same

s

1.5811.

Word problems

s² = Sxx/(n − 1), with Sxx = Σx² − (Σx)²/n. Dividing by n − 1 makes it unbiased.

Sxx

Σx = 20, Σx² = 120, n = 4.

  1. 120 − 100
  2. Check: ✓20

s²

Divide by 3.

  1. 20/3
  2. Check: ✓6.6667

Second data set Higher

Σx = 15, Σx² = 55, n = 5.

  1. (55 − 45)/4
  2. Check: ✓2.5

s Higher

√2.5.

  1. 1.5811
  2. Check: ✓1.5811

Common mistakes

Divide by n

n ✗

n − 1 ✓

Unbiased.

Σx² − (Σx)

no square ✗

(Σx)²/n ✓

Formula.

Using s² as s

s² ✗

√s² ✓

Standard deviation.

Negative Sxx

possible ✗

never ✓

Sum of squares.

Exam tips

  1. Sxx = Σx² − (Σx)²/n.
  2. s² = Sxx/(n − 1).
  3. s = √s².
  4. Check Sxx ≥ 0.
  5. Calculator: use sx, not σx.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. Sxx: Σx = 30, Σx² = 200, n = 5 Foundation

20

2. s²: Sxx = 20, n = 5 Foundation

5

3. s²: Σx = 12, Σx² = 60, n = 4 Foundation

8

4. s: Sxx = 18, n = 3, 4 dp Higher

3

5. Sxx: Σx = 10, Σx² = 30, n = 4 Higher

5

6. s²: Σx = 6, Σx² = 14, n = 3 Higher

1

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Sample variance
s².
Sxx
Sum of squared deviations.
Unbiased
E(s²) = σ².
Degrees of freedom
n − 1.
Standard deviation
s.
Population variance
σ².

Frequently asked questions

What is the sample variance?

s² = Sxx/(n − 1).

Why n − 1?

To make s² unbiased for σ².

What is Sxx?

Σx² − (Σx)²/n.

What is s?

The square root of s².

Which page covers the t statistic?

one-sample t statistic.

Which page covers confidence intervals?

confidence interval, σ unknown.

More in Statistics and the formula sheets.