Sample Variance Notes
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
- Set up the problem.
- Write the formula.
- Find the mean of the values.
- Subtract the mean from each value.
- Square each difference.
- Add the squared differences.
- Substitute the total and the count into the formula.
- 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.
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
- How to find the mean, covered in the Mean Calculator.
- How to add the squared differences, covered in the Sum Calculator.
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
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the mean of the values.
- Subtract the mean from each value.
- Square each difference.
- Add the squared differences.
- Substitute the total and the count into the formula.
- 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.
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.
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.
Step 3
Step 3 - Find the mean of the values.
In this problem: The mean of the values is \(\bar{x} = 3\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the total of the values and how many values there are.
- Substitute the total and the count into the formula.
- Divide to get the mean.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the mean of the values \(1,\; 2,\; 3,\; 4,\; 5\).
Step 2
Step 2 - Write the formula.
In this problem: The mean shares the total equally between the values, so the total is divided by how many there are.
Step 3
Step 3 - Find the total of the values and how many values there are.
In this problem: The formula needs the total \(\Sigma x\) of the values and their count \(n\).
Step 3a
Step 3a - Add the values together.
In this problem: Adding the values in order gives \(1 + 2 + 3 + 4 + 5 = 15\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(5\) values \(1,\; 2,\; 3,\; 4,\; 5\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(1 + 2 + 3 + 4 + 5 = 15\).
Final Answer
Step 3b
Step 3b - Count the values.
In this problem: Counting along the list reaches \(5\) at the last value, so \(n = 5\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Count the values in the list.
Step 1
Step 1 - Set up the problem.
In this problem: We are counting how many values are in the list \(1,\; 2,\; 3,\; 4,\; 5\).
Step 2
Step 2 - Write the formula.
In this problem: The count is simply how many values the list holds, written as n.
Step 3
Step 3 - Count the values in the list.
In this problem: Counting along the list from left to right reaches \(5\) at the last value, so \(n = 5\).
Final Answer
Step 4
Step 4 - Substitute the total and the count into the formula.
In this problem: Replacing \(\Sigma x\) with \(15\) and \(n\) with \(5\) gives \(\bar{x} = \frac{15}{5}\).
Step 5
Step 5 - Divide to get the mean.
In this problem: Dividing the total by the count gives \(15 \div 5 = 3\).
Final Answer
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\).
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\).
Step 6
Step 6 - Add the squared differences.
In this problem: Adding the squared differences gives \(4 + 1 + 0 + 1 + 4 = 10\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(5\) values \(4,\; 1,\; 0,\; 1,\; 4\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(4 + 1 + 0 + 1 + 4 = 10\).
Final Answer
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}\).
Step 8
Step 8 - Divide to get the sample variance.
In this problem: Dividing by \(5 - 1 = 4\) gives \(10 \div 4 = 2.5\).
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the mean of the values.
- Subtract the mean from each value.
- Square each difference.
- Add the squared differences.
- Substitute the total and the count into the formula.
- 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.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding how spread out the sample \(3,\; 7,\; 7,\; 19\) is.
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.
Step 3
Step 3 - Find the mean of the values.
In this problem: The mean of the values is \(\bar{x} = 9\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the total of the values and how many values there are.
- Substitute the total and the count into the formula.
- Divide to get the mean.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the mean of the values \(3,\; 7,\; 7,\; 19\).
Step 2
Step 2 - Write the formula.
In this problem: The mean shares the total equally between the values, so the total is divided by how many there are.
Step 3
Step 3 - Find the total of the values and how many values there are.
In this problem: The formula needs the total \(\Sigma x\) of the values and their count \(n\).
Step 3a
Step 3a - Add the values together.
In this problem: Adding the values in order gives \(3 + 7 + 7 + 19 = 36\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(4\) values \(3,\; 7,\; 7,\; 19\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(3 + 7 + 7 + 19 = 36\).
Final Answer
Step 3b
Step 3b - Count the values.
In this problem: Counting along the list reaches \(4\) at the last value, so \(n = 4\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Count the values in the list.
Step 1
Step 1 - Set up the problem.
In this problem: We are counting how many values are in the list \(3,\; 7,\; 7,\; 19\).
Step 2
Step 2 - Write the formula.
In this problem: The count is simply how many values the list holds, written as n.
Step 3
Step 3 - Count the values in the list.
In this problem: Counting along the list from left to right reaches \(4\) at the last value, so \(n = 4\).
Final Answer
Step 4
Step 4 - Substitute the total and the count into the formula.
In this problem: Replacing \(\Sigma x\) with \(36\) and \(n\) with \(4\) gives \(\bar{x} = \frac{36}{4}\).
Step 5
Step 5 - Divide to get the mean.
In this problem: Dividing the total by the count gives \(36 \div 4 = 9\).
Final Answer
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\).
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\).
Step 6
Step 6 - Add the squared differences.
In this problem: Adding the squared differences gives \(36 + 4 + 4 + 100 = 144\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(4\) values \(36,\; 4,\; 4,\; 100\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(36 + 4 + 4 + 100 = 144\).
Final Answer
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}\).
Step 8
Step 8 - Divide to get the sample variance.
In this problem: Dividing by \(4 - 1 = 3\) gives \(144 \div 3 = 48\).
Final Answer
See Example 3 Hide Example 3
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the mean of the values.
- Subtract the mean from each value.
- Square each difference.
- Add the squared differences.
- Substitute the total and the count into the formula.
- 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.
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.
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.
Step 3
Step 3 - Find the mean of the values.
In this problem: The mean of the values is \(\bar{x} = 5\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the total of the values and how many values there are.
- Substitute the total and the count into the formula.
- Divide to get the mean.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the mean of the values \(2,\; 4,\; 4,\; 4,\; 5,\; 5,\; 7,\; 9\).
Step 2
Step 2 - Write the formula.
In this problem: The mean shares the total equally between the values, so the total is divided by how many there are.
Step 3
Step 3 - Find the total of the values and how many values there are.
In this problem: The formula needs the total \(\Sigma x\) of the values and their count \(n\).
Step 3a
Step 3a - Add the values together.
In this problem: Adding the values in order gives \(2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(8\) values \(2,\; 4,\; 4,\; 4,\; 5,\; 5,\; 7,\; 9\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(2 + 4 + 4 + 4 + 5 + 5 + 7 + 9 = 40\).
Final Answer
Step 3b
Step 3b - Count the values.
In this problem: Counting along the list reaches \(8\) at the last value, so \(n = 8\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Count the values in the list.
Step 1
Step 1 - Set up the problem.
In this problem: We are counting how many values are in the list \(2,\; 4,\; 4,\; 4,\; 5,\; 5,\; 7,\; 9\).
Step 2
Step 2 - Write the formula.
In this problem: The count is simply how many values the list holds, written as n.
Step 3
Step 3 - Count the values in the list.
In this problem: Counting along the list from left to right reaches \(8\) at the last value, so \(n = 8\).
Final Answer
Step 4
Step 4 - Substitute the total and the count into the formula.
In this problem: Replacing \(\Sigma x\) with \(40\) and \(n\) with \(8\) gives \(\bar{x} = \frac{40}{8}\).
Step 5
Step 5 - Divide to get the mean.
In this problem: Dividing the total by the count gives \(40 \div 8 = 5\).
Final Answer
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\).
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\).
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\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(8\) values \(9,\; 1,\; 1,\; 1,\; 0,\; 0,\; 4,\; 16\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(9 + 1 + 1 + 1 + 0 + 0 + 4 + 16 = 32\).
Final Answer
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}\).
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\).
Final Answer
See Example 4 Hide Example 4
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the mean of the values.
- Subtract the mean from each value.
- Square each difference.
- Add the squared differences.
- Substitute the total and the count into the formula.
- 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.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding how spread out the sample \(5,\; 5,\; 6,\; 8\) is.
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.
Step 3
Step 3 - Find the mean of the values.
In this problem: The mean of the values is \(\bar{x} = 6\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Find the total of the values and how many values there are.
- Substitute the total and the count into the formula.
- Divide to get the mean.
Step 1
Step 1 - Set up the problem.
In this problem: We are finding the mean of the values \(5,\; 5,\; 6,\; 8\).
Step 2
Step 2 - Write the formula.
In this problem: The mean shares the total equally between the values, so the total is divided by how many there are.
Step 3
Step 3 - Find the total of the values and how many values there are.
In this problem: The formula needs the total \(\Sigma x\) of the values and their count \(n\).
Step 3a
Step 3a - Add the values together.
In this problem: Adding the values in order gives \(5 + 5 + 6 + 8 = 24\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(4\) values \(5,\; 5,\; 6,\; 8\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(5 + 5 + 6 + 8 = 24\).
Final Answer
Step 3b
Step 3b - Count the values.
In this problem: Counting along the list reaches \(4\) at the last value, so \(n = 4\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Count the values in the list.
Step 1
Step 1 - Set up the problem.
In this problem: We are counting how many values are in the list \(5,\; 5,\; 6,\; 8\).
Step 2
Step 2 - Write the formula.
In this problem: The count is simply how many values the list holds, written as n.
Step 3
Step 3 - Count the values in the list.
In this problem: Counting along the list from left to right reaches \(4\) at the last value, so \(n = 4\).
Final Answer
Step 4
Step 4 - Substitute the total and the count into the formula.
In this problem: Replacing \(\Sigma x\) with \(24\) and \(n\) with \(4\) gives \(\bar{x} = \frac{24}{4}\).
Step 5
Step 5 - Divide to get the mean.
In this problem: Dividing the total by the count gives \(24 \div 4 = 6\).
Final Answer
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\).
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\).
Step 6
Step 6 - Add the squared differences.
In this problem: Adding the squared differences gives \(1 + 1 + 0 + 4 = 6\).
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the formula.
- Add the values together to get the total.
Step 1
Step 1 - Set up the problem.
In this problem: We are adding the \(4\) values \(1,\; 1,\; 0,\; 4\) together.
Step 2
Step 2 - Write the formula.
In this problem: The total is what every value adds up to, written as the sum of all the values.
Step 3
Step 3 - Add the values together to get the total.
In this problem: Adding them in order gives \(1 + 1 + 0 + 4 = 6\).
Final Answer
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}\).
Step 8
Step 8 - Divide to get the sample variance.
In this problem: Dividing by \(4 - 1 = 3\) gives \(6 \div 3 = 2\).
Final Answer
Calculator and Practice Mode
Want to check your own working? The Sample Variance Calculator solves any problem you type in and shows every step, so you can compare it line by line with your answer and find exactly where a mistake crept in. When you are ready to test yourself, Sample Variance Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode is available on the Plus and Pro plans.