Variance is a measure of dispersion in statistics: it quantifies how far the values of a variable spread around their mean, calculated as the average of the squared deviations from that mean. A variance of zero means every value is identical; larger values mean the data are more spread out.
Variance is written as σ² for a population and s² for a sample. Its square root is the standard deviation, which is easier to interpret because it uses the original units. Variance itself matters because it has convenient mathematical properties: variances of independent quantities add up, which makes it the working currency of regression, analysis of variance, experiment design and portfolio risk.
How variance is calculated
The calculation follows three steps: find the mean, compute each value’s deviation from the mean, square those deviations and average them. Squaring makes every deviation positive and gives large deviations disproportionate weight.
For the values 2, 4, 4, 4, 5, 5, 7 and 9, the mean is 5. The squared deviations are 9, 1, 1, 1, 0, 0, 4 and 16, which sum to 32. Dividing by n = 8 gives a population variance of 4; dividing by n − 1 = 7 gives a sample variance of about 4.57. The standard deviation is 2 in the first case and about 2.14 in the second.
| Version | Symbol | Divisor | When to use it |
|---|---|---|---|
| Population variance | σ² | N, the number of all values | The data cover the entire population of interest |
| Sample variance | s² | n − 1 | The data are a sample used to estimate a larger population |
The n − 1 divisor, known as Bessel’s correction, compensates for the fact that a sample’s own mean is closer to its values than the unknown population mean. Without it, sample variance would systematically underestimate the population variance, especially in small samples. With hundreds of observations the difference becomes negligible.
Properties that make variance useful
Variance behaves predictably under common transformations, which is why statistical theory is built on it rather than on more intuitive spread measures. The following rules are used constantly in modeling and estimation.
| Operation | Effect on variance | Practical meaning |
|---|---|---|
| Adding a constant | No change | Shifting all values does not change spread |
| Multiplying by a constant c | Multiplied by c² | Converting meters to centimeters multiplies variance by 10,000 |
| Sum of independent variables | Variances add | Independent errors accumulate predictably |
| Sum of correlated variables | Variances plus twice the covariance | Correlation increases or reduces combined risk |
| Mean of n independent values | Divided by n | Averages become more stable as samples grow |
The last rule explains the standard error of the mean: the variance of an average falls in proportion to 1/n, so its standard deviation falls with 1/√n. To halve the uncertainty of an estimate, a study needs roughly four times as many observations.
Variance compared with other spread measures
Variance is one of several ways to describe dispersion. Its main weakness for communication is the squared unit: a variance of delivery times in minutes is expressed in square minutes, which has no intuitive meaning.
| Measure | Units | Sensitivity to outliers | Best use |
|---|---|---|---|
| Variance | Squared original units | High | Modeling, decomposition, theory |
| Standard deviation | Original units | High | Reporting typical spread around the mean |
| Interquartile range | Original units | Low | Skewed data, robust summaries with the median |
| Median absolute deviation | Original units | Very low | Outlier detection, robust statistics |
| Range | Original units | Extreme | Quick checks only |
| Coefficient of variation | Unitless ratio | High | Comparing spread across different scales |
For skewed or heavy-tailed data, such as incomes, response times or transaction sizes, a few extreme values can dominate the variance. In those cases the interquartile range or percentiles describe typical behavior better, while variance remains useful in models that explicitly account for the distribution.
Where variance is used in data work
Variance appears throughout statistics and analytics, often under other names. Recognizing it helps in reading model output and in planning analyses.
- Analysis of variance (ANOVA) splits total variance into variation between groups and within groups to test whether group means differ.
- Regression reports R², the share of the outcome’s variance that the model explains.
- Experiment planning uses the expected variance of a metric to calculate the required sample size; noisier metrics need larger samples.
- Principal component analysis ranks components by the share of total variance they capture.
- Finance uses variance of returns as a basic risk measure, combined with covariance in portfolio construction.
- Machine learning uses the bias-variance trade-off to describe models that fit training data too closely.
In online experiments, variance reduction techniques such as using pre-experiment behavior as a covariate can shrink metric variance substantially. Smaller variance means shorter tests or detection of smaller effects with the same traffic.
Common mistakes with variance
Most errors with variance come from mixing up definitions or from applying it to data where it is not informative. The table lists the most frequent ones.
| Mistake | Consequence | Correction |
|---|---|---|
| Wrong divisor | Estimates differ between tools | Check whether a function uses n or n − 1 |
| Reporting variance to non-specialists | Squared units confuse readers | Report the standard deviation instead |
| Ignoring outliers | One extreme value inflates spread | Inspect distributions, consider robust measures |
| Adding variances of correlated values | Combined risk is misjudged | Include the covariance term |
| Comparing variances across scales | Larger units look more variable | Use the coefficient of variation |
Spreadsheet and software functions differ in their default divisor, so two tools can report different variances for the same data. Always confirm which version a function computes before comparing results.
Understanding it simply
Variance tells how scattered a set of numbers is. Imagine two bus lines that both arrive on average at 8:00. One always comes between 7:58 and 8:02. The other comes anywhere from 7:45 to 8:15.
Both have the same average, but the second has a much higher variance. Its arrivals are far less predictable. Variance is calculated from squared distances to the average, so large misses count heavily. Low variance means consistency; high variance means surprises.
Applied in practice
A food producer fills bags labeled 500 grams on two packing lines. Both lines average about 503 grams, but quality control samples 50 bags from each line every shift. Line A shows a standard deviation of 2 grams, a variance of 4. Line B shows a standard deviation of 6 grams, a variance of 36.
With the same average, Line B produces far more bags below the labeled weight, so the company must set its target fill higher to stay compliant. That wastes product on every bag. Engineers trace the extra variance to a worn dosing valve.
After the repair, Line B’s variance falls to about the level of Line A. The company then lowers its target fill by a few grams. Reducing variance, not changing the average, saves product on every bag while keeping underweight bags rare.