Britannica Sources used in this answer

How is sample variance calculated using deviations from the sample mean?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

To calculate the sample variance (s2), you must first determine the mean of your data set.1

The calculation follows these steps:

  • Find the deviations: Subtract the sample mean from each individual data value (xi) to find the deviation of each point.1
  • Square the deviations: Square each of these individual differences.1
  • Sum the squares: Add all of these squared deviations together.1
  • Divide: Divide the resulting sum by n−1, where n is the total number of items in the sample.1

Using n−1 (often called Bessel's correction) instead of n provides an unbiased estimate of the population variance from a sample. This measure of variability is fundamental in statistics because it accounts for all data points in a set, unlike simpler measures like the range.1