Variance: Definition, Method and Examples

MathPublished

Variance in Statistics

Variance is the average of the squared distances of data values from their mean. Squaring makes every distance non-negative and emphasises larger deviations; its units are squared, and its square root is the standard deviation.

What is variance?

Variance is a measure of spread that describes how far a set of data points is dispersed from their mean. A low variance indicates that data points are tightly clustered around the average, while a high data variance means the values are widely spread out. A variance of zero means all data values in the set are perfectly identical.


In statistics, variance is represented by the symbol σ2\sigma^2 (sigma squared) for a full population, and s2s^2 for a sample.

Two dot plots compare variance. The top plot shows tightly clustered points for a low variance. The bottom plot shows spread-out points for a high variance.

Find deviations from the mean

To understand how to calculate variance, we first find the center of the data. For each data point xx, we calculate its deviation by subtracting the mean μ\mu:

Deviation =x−μ= x - \mu


If a value is larger than the mean, its deviation is positive. If a value is smaller, its deviation is negative. A common mistake is assuming we can just add up these raw deviations to find the overall spread. However, the signed deviations alone always sum to zero. The positive differences perfectly balance the negative differences because the mean is the exact mathematical center of the data.

A number line showing data points at 3, 5, 7, and 9. Arrows show the negative and positive deviations exactly balancing around the mean of 6.

Square and average deviations

To stop the positive and negative deviations from canceling out, we square each difference to find the squared deviation. Squaring not only ensures every value is positive or zero, but it also applies a larger penalty to data points that are further from the mean.

A number line with a mean of 4. Squares with an area of 4 rest on the segments from 2 to 4 and 4 to 6 to visually represent the squared deviations.


After finding the squared deviation for each point, we find the average of these squared values.


For a complete population of NN items, the variance formula divides the sum by NN:

σ2=∑(x−μ)2N\sigma^2 = \dfrac{\sum (x - \mu)^2}{N}

When working with a smaller sample of the population, we adjust the average by dividing by n−1n - 1 (where nn is the sample size) to correct for missing information:

s2=∑(x−xˉ)2n−1s^2 = \dfrac{\sum (x - \bar{x})^2}{n - 1}

Compare variance and standard deviation

When evaluating variance vs standard deviation, both measure how spread out data is, but they represent different steps in the same mathematical process. Standard deviation is exactly the square root of the variance:

σ=σ2\sigma = \sqrt{\sigma^2}


You must calculate the variance first. Only after the variance is secure do you take the square root to find the standard deviation. While variance simplifies many statistical calculations, standard deviation is often easier to interpret because it describes specific probabilities in models like the normal distribution.

Interpret squared units

Because the variance formula squares every deviation, its final result is expressed in squared units. If a dataset measures the heights of plants in centimeters, the variance is in squared centimeters. If tracking time in seconds, the variance is in squared seconds.


These squared units are mathematically useful but difficult to visualize. This is why standard deviation is often preferred for reporting—taking the square root returns the measure of spread to the original units of the data. Both variance and standard deviation provide a much deeper look at how data behaves than simpler measures like the range in statistics or basic visual shapes like histograms.

Worked examples


Example 1: Calculating population variance


Question: Find the population variance of the dataset: 4,6,8,104, 6, 8, 10.


Method:

  1. Find the mean.
  2. Find the deviation from the mean for each value.
  3. Square each deviation.
  4. Average the squared deviations by dividing by NN.

Data (xx)

Mean (μ\mu)

Deviation (x−μx - \mu)

Squared Deviation (x−μ)2(x - \mu)^2

44

77

−3-3

99

66

77

−1-1

11

88

77

11

11

1010

77

33

99

Sum of squared deviations =9+1+1+9=20= 9 + 1 + 1 + 9 = 20.

Since there are 44 data points, the population size is N=4N = 4.

Variance =204=5= \dfrac{20}{4} = 5.

Answer: The population variance is 55.


Check: Ensure the sum of the unsquared deviations (−3−1+1+3-3 - 1 + 1 + 3) equals 00.


Example 2: Calculating sample variance


Question: Find the sample variance of the dataset: 2,5,82, 5, 8.


Method:

  1. Find the sample mean (xˉ\bar{x}).
  2. Find and square the deviations.
  3. Divide the sum by n−1n - 1 because this is a sample.

Mean (xˉ\bar{x}) =2+5+83=153=5= \dfrac{2 + 5 + 8}{3} = \dfrac{15}{3} = 5.

Data (xx)

Deviation (x−xˉx - \bar{x})

(x−xˉ)2(x - \bar{x})^2

22

−3-3

99

55

00

00

88

33

99

Sum of squared deviations =9+0+9=18= 9 + 0 + 9 = 18.

The sample size is n=3n = 3, so n−1=2n - 1 = 2.

Sample variance s2=182=9s^2 = \dfrac{18}{2} = 9.

Answer: The sample variance is 99.


Check: The standard deviation is 9=3\sqrt{9} = 3, which aligns with the data being spread exactly 33 units away from the mean.


Example 3: Working backward from variance


Question: The population variance of a dataset is 3636 square meters. What is the standard deviation?


Method:

  1. Identify the relationship between variance and standard deviation.
  2. The standard deviation is the square root of the variance.
  3. σ=σ2\sigma = \sqrt{\sigma^2}
  4. σ=36\sigma = \sqrt{36}

Answer: The standard deviation is 66 meters.


Check: 6×6=366 \times 6 = 36, which correctly returns the variance in square meters.

Common mistakes

  • Forgetting to square: Trying to average the raw deviations will always result in zero. You must calculate the squared deviation for every data point.
  • Using the wrong denominator: Dividing by NN for a sample instead of n−1n - 1 will artificially underestimate the true variance.
  • Confusing variance and standard deviation: Remembering that standard deviation is the square root of the variance is crucial. The variance itself is σ2\sigma^2, not σ\sigma.

Frequently asked questions

Can variance fall below zero?

No. Because the calculation involves squaring the deviations, every term in the sum is either zero or a positive number. The lowest possible variance is zero, which occurs only when every single data value is perfectly identical.


Why does sample variance divide by n−1n - 1?

When we only have a sample, we do not know the true population mean. Using the sample mean slightly underestimates the spread. Dividing by n−1n - 1, rather than nn, perfectly adjusts for this underestimation.

Practice questions

Question

Two dot plots shown on identical number lines from 2 to 10. Dataset A has points spread out at 2, 4, 8, and 10. Dataset B has points clustered at 5, 6, 6, and 7.

Which dataset has a higher variance?

  • Dataset A

  • Dataset B

  • They have the same variance

  • Cannot be determined

Answer:

Dataset A

Question

Find the sample variance of the dataset: 2,5,112, 5, 11.

  • 1414

  • 2121

  • 4242

  • 77

Answer:

2121

Question

A blue square with an area labeled Variance = 144. An arrow beneath the square points to its side length, labeled Standard Deviation = ?


If the area of the square above represents a dataset's variance of 144144, what is the standard deviation?

  • 1212

  • 7272

  • 288288

  • 20,73620{,}736

Answer:

1212

Question

Why do we divide by n−1n - 1 instead of nn when calculating the sample variance?

  • To correct for the underestimation of the spread when using a sample mean.

  • To make the variance exactly equal to the standard deviation.

  • Because a sample always has one less data point than a population.

  • To ensure the calculated variance remains a positive number.

Answer:

To correct for the underestimation of the spread when using a sample mean.

Question

Which of the following statements about variance is correct?

  • The variance falls below zero if the dataset contains negative values.

  • You calculate variance by averaging the absolute values of the differences.

  • Standard deviation is exactly the square root of the variance.

  • A variance of one indicates that all data points are identical.

Answer:

Standard deviation is exactly the square root of the variance.