Sample Variance Notes

Published on: November 26, 2026

These Sample Variance Notes explain how to measure how spread out a sample is, with the working shown line by line. The method finds the mean, takes it away from each value and squares the differences so values above and below the mean don't cancel out. The squares are added and divided by one less than the number of values, which corrects for a sample usually sitting closer to its own mean than the whole population does. The same pattern works for any list of numbers.

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Useful Tips to Remember

The sample variance is \(s^2 = \frac{\Sigma(x - \bar{x})^2}{n - 1}\), dividing by \(n - 1\) to correct for using a sample. Square each deviation from the mean before adding them. The variance is in squared units, so take the square root to get the standard deviation. It can never be negative.

Required knowledge

Where Is the Sample Variance Used?

The sample variance estimates how spread out a population is from a sample, using the squared deviations from the mean with \(n - 1\) in the denominator. Dividing by \(n - 1\) corrects the tendency of a sample to underestimate the true spread. Variance is the basis of many statistical methods, including analysis of variance, which compares several groups at once, and regression analysis. Researchers, engineers and financial analysts use it to measure variability, compare methods and build models from limited data.

  • Comparing groups with analysis of variance
  • Estimating variability from a limited sample
  • Building regression and forecasting models
  • Comparing the precision of measuring methods
  • Measuring the volatility of investment returns

Sample Variance Practice Problems

Example 1 uses 1, 2, 3, 4, 5, and Example 2 uses 3, 7, 7, 19. Examples 3 and 4 give you two more of the same kind to try, \(2,\; 4,\; 4,\; 4,\; 5,\; 5,\; 7,\; 9\) and \(5,\; 5,\; 6,\; 8\). Try squaring the deviations and dividing by \(n - 1\) yourself before opening each example.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. Try each problem on paper first, then open the example and check your working one step at a time, so you can see exactly which step went wrong if your answer does not match. Use them to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(1,\; 2,\; 3,\; 4,\; 5\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are finding how spread out the sample \(1,\; 2,\; 3,\; 4,\; 5\) is.

\(1,\; 2,\; 3,\; 4,\; 5\)

Step 2

Step 2 - Write the formula.

In this problem: For a sample, the squared differences from the mean are added and divided by one less than the number of values.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 3

Step 3 - Find the mean of the values.

In this problem: The mean of the values is \(\bar{x} = 3\).

\(\bar{x} = 3\)

Step 4

Step 4 - Subtract the mean from each value.

In this problem: Taking the mean away from each value in turn gives \(1 - 3 = -2\), \(2 - 3 = -1\), \(3 - 3 = 0\), \(4 - 3 = 1\), \(5 - 3 = 2\).

\(\begin{array}{c|c} x & x - \bar{x} \\ \hline 1 & -2 \\ 2 & -1 \\ 3 & 0 \\ 4 & 1 \\ 5 & 2 \end{array}\)

Step 5

Step 5 - Square each difference.

In this problem: Squaring each difference removes the minus signs, giving \(\left(-2\right)^{2} = 4\), \(\left(-1\right)^{2} = 1\), \(0^{2} = 0\), \(1^{2} = 1\), \(2^{2} = 4\).

\(\begin{array}{c|c} x - \bar{x} & (x - \bar{x})^{2} \\ \hline -2 & 4 \\ -1 & 1 \\ 0 & 0 \\ 1 & 1 \\ 2 & 4 \end{array}\)

Step 6

Step 6 - Add the squared differences.

In this problem: Adding the squared differences gives \(4 + 1 + 0 + 1 + 4 = 10\).

\(\Sigma (x - \bar{x})^{2} = 4 + 1 + 0 + 1 + 4 = 10\)

Step 7

Step 7 - Substitute the total and the count into the formula.

In this problem: Replacing the total with \(10\) and \(n\) with \(5\), the number of values, gives \(s^{2} = \frac{10}{5 - 1}\).

\(s^{2} = \frac{10}{5 - 1}\)

Step 8

Step 8 - Divide to get the sample variance.

In this problem: Dividing by \(5 - 1 = 4\) gives \(10 \div 4 = 2.5\).

\(s^{2} = \frac{10}{5 - 1} = 2.5\)

Final Answer

\(s^{2} = 2.5\)
See Example 2 Hide Example 2

Problem

\(3,\; 7,\; 7,\; 19\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are finding how spread out the sample \(3,\; 7,\; 7,\; 19\) is.

\(3,\; 7,\; 7,\; 19\)

Step 2

Step 2 - Write the formula.

In this problem: For a sample, the squared differences from the mean are added and divided by one less than the number of values.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 3

Step 3 - Find the mean of the values.

In this problem: The mean of the values is \(\bar{x} = 9\).

\(\bar{x} = 9\)

Step 4

Step 4 - Subtract the mean from each value.

In this problem: Taking the mean away from each value in turn gives \(3 - 9 = -6\), \(7 - 9 = -2\), \(7 - 9 = -2\), \(19 - 9 = 10\).

\(\begin{array}{c|c} x & x - \bar{x} \\ \hline 3 & -6 \\ 7 & -2 \\ 7 & -2 \\ 19 & 10 \end{array}\)

Step 5

Step 5 - Square each difference.

In this problem: Squaring each difference removes the minus signs, giving \(\left(-6\right)^{2} = 36\), \(\left(-2\right)^{2} = 4\), \(\left(-2\right)^{2} = 4\), \(10^{2} = 100\).

\(\begin{array}{c|c} x - \bar{x} & (x - \bar{x})^{2} \\ \hline -6 & 36 \\ -2 & 4 \\ -2 & 4 \\ 10 & 100 \end{array}\)

Step 6

Step 6 - Add the squared differences.

In this problem: Adding the squared differences gives \(36 + 4 + 4 + 100 = 144\).

\(\Sigma (x - \bar{x})^{2} = 36 + 4 + 4 + 100 = 144\)

Step 7

Step 7 - Substitute the total and the count into the formula.

In this problem: Replacing the total with \(144\) and \(n\) with \(4\), the number of values, gives \(s^{2} = \frac{144}{4 - 1}\).

\(s^{2} = \frac{144}{4 - 1}\)

Step 8

Step 8 - Divide to get the sample variance.

In this problem: Dividing by \(4 - 1 = 3\) gives \(144 \div 3 = 48\).

\(s^{2} = \frac{144}{4 - 1} = 48\)

Final Answer

\(s^{2} = 48\)
See Example 3 Hide Example 3

Problem

\(2,\; 4,\; 4,\; 4,\; 5,\; 5,\; 7,\; 9\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are finding how spread out the sample \(2,\; 4,\; 4,\; 4,\; 5,\; 5,\; 7,\; 9\) is.

\(2,\; 4,\; 4,\; 4,\; 5,\; 5,\; 7,\; 9\)

Step 2

Step 2 - Write the formula.

In this problem: For a sample, the squared differences from the mean are added and divided by one less than the number of values.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 3

Step 3 - Find the mean of the values.

In this problem: The mean of the values is \(\bar{x} = 5\).

\(\bar{x} = 5\)

Step 4

Step 4 - Subtract the mean from each value.

In this problem: Taking the mean away from each value in turn gives \(2 - 5 = -3\), \(4 - 5 = -1\), \(4 - 5 = -1\), \(4 - 5 = -1\), \(5 - 5 = 0\), \(5 - 5 = 0\), \(7 - 5 = 2\), \(9 - 5 = 4\).

\(\begin{array}{c|c} x & x - \bar{x} \\ \hline 2 & -3 \\ 4 & -1 \\ 4 & -1 \\ 4 & -1 \\ 5 & 0 \\ 5 & 0 \\ 7 & 2 \\ 9 & 4 \end{array}\)

Step 5

Step 5 - Square each difference.

In this problem: Squaring each difference removes the minus signs, giving \(\left(-3\right)^{2} = 9\), \(\left(-1\right)^{2} = 1\), \(\left(-1\right)^{2} = 1\), \(\left(-1\right)^{2} = 1\), \(0^{2} = 0\), \(0^{2} = 0\), \(2^{2} = 4\), \(4^{2} = 16\).

\(\begin{array}{c|c} x - \bar{x} & (x - \bar{x})^{2} \\ \hline -3 & 9 \\ -1 & 1 \\ -1 & 1 \\ -1 & 1 \\ 0 & 0 \\ 0 & 0 \\ 2 & 4 \\ 4 & 16 \end{array}\)

Step 6

Step 6 - Add the squared differences.

In this problem: Adding the squared differences gives \(9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32\).

\(\Sigma (x - \bar{x})^{2} = 9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32\)

Step 7

Step 7 - Substitute the total and the count into the formula.

In this problem: Replacing the total with \(32\) and \(n\) with \(8\), the number of values, gives \(s^{2} = \frac{32}{8 - 1}\).

\(s^{2} = \frac{32}{8 - 1}\)

Step 8

Step 8 - Divide to get the sample variance.

In this problem: Dividing by \(8 - 1 = 7\) gives \(32 \div 7 \approx 4.57\).

\(s^{2} = \frac{32}{8 - 1} \approx 4.57\)

Final Answer

\(s^{2} \approx 4.57\)
See Example 4 Hide Example 4

Problem

\(5,\; 5,\; 6,\; 8\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the values.
  4. Subtract the mean from each value.
  5. Square each difference.
  6. Add the squared differences.
  7. Substitute the total and the count into the formula.
  8. Divide to get the sample variance.

Formula

Formula: Sample Variance Formula

This formula averages the squared distances from the mean using n - 1 instead of n. Take the mean from each value, square, add, then divide by n - 1.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are finding how spread out the sample \(5,\; 5,\; 6,\; 8\) is.

\(5,\; 5,\; 6,\; 8\)

Step 2

Step 2 - Write the formula.

In this problem: For a sample, the squared differences from the mean are added and divided by one less than the number of values.

\(s^{2} = \frac{\Sigma (x - \bar{x})^{2}}{n - 1}\)

Step 3

Step 3 - Find the mean of the values.

In this problem: The mean of the values is \(\bar{x} = 6\).

\(\bar{x} = 6\)

Step 4

Step 4 - Subtract the mean from each value.

In this problem: Taking the mean away from each value in turn gives \(5 - 6 = -1\), \(5 - 6 = -1\), \(6 - 6 = 0\), \(8 - 6 = 2\).

\(\begin{array}{c|c} x & x - \bar{x} \\ \hline 5 & -1 \\ 5 & -1 \\ 6 & 0 \\ 8 & 2 \end{array}\)

Step 5

Step 5 - Square each difference.

In this problem: Squaring each difference removes the minus signs, giving \(\left(-1\right)^{2} = 1\), \(\left(-1\right)^{2} = 1\), \(0^{2} = 0\), \(2^{2} = 4\).

\(\begin{array}{c|c} x - \bar{x} & (x - \bar{x})^{2} \\ \hline -1 & 1 \\ -1 & 1 \\ 0 & 0 \\ 2 & 4 \end{array}\)

Step 6

Step 6 - Add the squared differences.

In this problem: Adding the squared differences gives \(1 + 1 + 0 + 4 = 6\).

\(\Sigma (x - \bar{x})^{2} = 1 + 1 + 0 + 4 = 6\)

Step 7

Step 7 - Substitute the total and the count into the formula.

In this problem: Replacing the total with \(6\) and \(n\) with \(4\), the number of values, gives \(s^{2} = \frac{6}{4 - 1}\).

\(s^{2} = \frac{6}{4 - 1}\)

Step 8

Step 8 - Divide to get the sample variance.

In this problem: Dividing by \(4 - 1 = 3\) gives \(6 \div 3 = 2\).

\(s^{2} = \frac{6}{4 - 1} = 2\)

Final Answer

\(s^{2} = 2\)

Calculator and Practice Mode