Sample Variance
High school
Consider data $x_1, \dots, x_n$ that are a random sample from a larger population, with sample mean $\bar{x}$. The sample variance of the data is the sum of the squared distances from the mean divided by $n - 1$:
\[s^2 = \frac{1}{n - 1} \sum_{i = 1}^{n} (x_i - \bar{x})^2.\]The sample variance estimates the variance of the whole population.
Undergraduate (statistics)
Consider independent random variables $X_1, \dots, X_n$ that have the same distribution, with sample mean $\bar{X} = \frac{1}{n} \sum_{i = 1}^{n} X_i$, such that $n \geq 2$. The sample variance is the random variable
\[S^2 = \frac{1}{n - 1} \sum_{i = 1}^{n} (X_i - \bar{X})^2.\]Examples
Worked examples
-
Value:
$\frac{(1.5)^2 + (0.5)^2 + (0.5)^2 + (1.5)^2}{3} = \frac{5}{3} \approx 1.67$
The sample variance of the data $1, 2, 3, 4$ divides the sum $5$ of the squared distances from the mean $2.5$ by $4 - 1 = 3$. -
Value:
Undefined
The sample variance of the single data point $5$ is undefined, because the formula divides $0$ by $1 - 1 = 0$; one measurement says nothing about how spread out the population is.
Properties
- The sample variance is an unbiased estimator of the variance $\sigma^2$ of each $X_i$: $\mathbb{E}[S^2] = \sigma^2$.
- The data are closer, on average, to their own sample mean $\bar{x}$ than to the population mean $\mu$, because $\bar{x}$ is the number that minimizes the sum of squared distances to the data. Dividing by $n$ would therefore underestimate the variance on average, and dividing by $n - 1$ instead (Bessel’s correction) exactly compensates.
- The sample variance of a single data point is undefined, because one data point carries no information about the spread of the population.
Distinctions involving this term
- Variance vs. Sample Variance: The spread of data is measured by the average squared distance of the data from their mean. The variance of the data divides the sum of the squared distances by the number $n$ of data points, which describes the data themselves. The sample variance divides by $n - 1$ instead, which gives an unbiased estimate of the variance of the population that the data were sampled from.
All definitions · All distinctions · All examples · Notation