Sample Variance — Definition, Formula & Examples
Sample variance is a measure of how far the values in a data set are spread out from their mean, calculated using a sample rather than an entire population. It divides by instead of to give an unbiased estimate of the true population variance.
Given a sample of observations with sample mean , the sample variance is defined as . The divisor represents the degrees of freedom and corrects for the bias that would occur if the population mean were estimated by the sample mean.
Key Formula
Where:
- = Sample variance
- = Each individual data value
- = Sample mean (average of all data values)
- = Number of data values in the sample
How It Works
To find the sample variance, start by computing the mean of your data. Then subtract the mean from each data point and square the result — these are the squared deviations. Add up all the squared deviations and divide by , not . The reason for dividing by (called Bessel's correction) is that a sample tends to underestimate the spread of the full population, and using compensates for that. A larger sample variance means the data points are more spread out from the mean.
Worked Example
Problem: Find the sample variance of the data set: 4, 8, 6, 10, 12.
Step 1: Find the sample mean: Add all values and divide by the number of data points.
Step 2: Compute each squared deviation: Subtract the mean from each value, then square the result.
Step 3: Sum the squared deviations: Add up all the squared differences.
Step 4: Divide by n − 1: Since there are 5 data points, divide by 4.
Answer: The sample variance is .
Visualization
Why It Matters
Sample variance appears throughout AP Statistics and introductory college statistics courses as a building block for hypothesis testing, confidence intervals, and regression analysis. In real-world research — from clinical drug trials to quality control in manufacturing — you almost never have data on the entire population, so sample variance is the version you actually compute. Taking the square root of sample variance gives you the sample standard deviation, which is reported in nearly every scientific paper.
Common Mistakes
Mistake: Dividing by n instead of n − 1
Correction: Dividing by n gives the population variance. When working with a sample, always divide by n − 1 to correct for bias. Check whether the problem says 'sample' or 'population' before choosing a formula.
Mistake: Forgetting to square the deviations
Correction: If you just sum (x_i − x̄) without squaring, the positive and negative differences cancel out and you get zero. Squaring ensures all deviations contribute positively to the total spread.
