Search for probability and statistics terms on Statlect
StatLect

Sample variance

by , PhD

Given a number of observations, their sample variance measures how far they are spread apart. It is also an estimator of the variance of the population from which the observations have been drawn.

Table of Contents

Formulae

Given n observations [eq1] having sample mean[eq2] there are two main ways to compute the sample variance:

Example

Suppose we observe four realizations:[eq5]

Their sample mean is:[eq6]

Dividing the sum of squared deviations from the mean by the number of observations, we obtain the unadjusted sample variance:[eq7]

Dividing it by the number of observations minus one, we instead obtain the unbiased estimate:[eq8]

How to calculate the sample variance using a table

When there are many observations, it may be convenient to organize the calculations into a table.

In the previous example, the calculations could have been performed as follows.

Observation numberValueDeviation from meanSquared deviation
14-11
24-11
3500
4724
Sum2006
Divide sum by n53/2
Divide sum by n-12

The sample variances are on the last two rows of the table.

Dispersion

The sample variance is a measure of dispersion of the observations around their sample mean.

A squared deviation quantifies how far an observation is from the mean.

The sample variance, being an average of the squared deviations, measures the average distance (or spread) from the mean.

Plot of two samples having low and high sample variances respectively.

Sample variance and population variance

Assume that the observations are all drawn from the same probability distribution.

Then, the variance of that probability distribution is called population variance.

When the n observations are independent, $S_{n}^{2}$ is a biased estimator of the population variance, while $s_{n}^{2}$ is unbiased.

More details

The lecture entitled Variance estimation provides more details about the sample variance, including derivations of its properties, examples and exercises.

Keep reading the glossary

Previous entry: Sample space

Next entry: Score vector

How to cite

Please cite as:

Taboga, Marco (2021). "Sample variance", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/glossary/sample-variance.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.