Bell Statistics

What is variance?

Variance is the average squared distance between each observation and the mean. It is the squared version of standard deviation, harder to interpret directly, and the form that adds cleanly across independent sources — which is why it appears inside almost every statistical formula.

Notation
σ²
Also called
squared deviation, sigma squared
Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

In plain English

Variance is the average of the squared distances between observations and their mean. Squaring does two things: it makes negative and positive deviations count equally, and it weights large deviations far more heavily than small ones. The cost is that the units are squared — variance in pounds is measured in pounds-squared, which nobody can picture — which is why standard deviation exists as its square root and is what gets reported.

The reason variance survives despite being unreadable is that it is additive. For independent quantities, the variance of a sum is the sum of the variances, which is not true of standard deviations. That single property is what makes derivations tractable: the variance of a difference between two independent group means is the sum of their two variances, which is where the standard error of every two-sample test comes from. Try to do that arithmetic with standard deviations and it does not work.

It is also the quantity every sample-size formula is denominated in. The number of observations required scales directly with variance, not with standard deviation, which is a distinction with a large practical consequence: halving the standard deviation quarters the required sample. That is why variance reduction is worth so much more than it sounds. A technique that removes 40% of the variance removes 40% of the required traffic, and one that halves the standard deviation removes 75% of it.

In experimentation the useful mental model is that variance comes from several sources and only some of them are informative. Some of it is the treatment effect you are looking for. Much more of it is stable differences between users — heavy users versus light ones — which is predictable from history and therefore removable with a pre-period covariate. Some is day-of-week and seasonal structure, removable by design. And some is genuinely irreducible noise. Variance reduction is the practice of identifying which parts are predictable and subtracting them.

One warning for skewed data. Because deviations are squared, a single extreme observation contributes enormously — a value ten standard deviations out adds a hundred times what a one-sigma value adds. On a revenue metric with a long tail, the variance is often dominated by a handful of orders, which makes it unstable between samples and makes any interval built on it fragile. Capping or winsorising is the standard response, and it has to be decided before results are seen.

The formula

The definition, the additivity property that makes it useful, and the two applications that matter most in practice.

Sample variance
s² = Σ(xᵢ − x̄)² / (n − 1)

n − 1 rather than n corrects the bias from measuring deviations against the sample's own mean.

Additivity
Var(X + Y) = Var(X) + Var(Y) for independent X, Y

The property standard deviations lack, and the reason variance appears in every derivation. Add a covariance term when they are not independent.

Variance of a difference in means
Var(x̄₁ − x̄₂) = σ₁²/n₁ + σ₂²/n₂

Straight from additivity, and the basis of every two-sample test — see the two-sample t-test calculator.

Sample size scales with it
n = 2·(z₁₋α/₂ + z₁₋β)² · σ² / δ²

Directly proportional. Removing 40% of the variance removes 40% of the traffic needed, which is the entire case for CUPED.

Worked example

A revenue-per-user metric has a variance of 8,281 (a standard deviation of £91). An analyst decomposes it to see what could be removed, using a pre-experiment window and a day-of-week decomposition.

Total variance
8,281 (SD £91)
Attributable to stable user differences
3,560 (43%)
Attributable to day-of-week and seasonality
660 (8%)
Attributable to the top 1% of orders
2,400 (29%)
Residual
1,661 (20%)
Sample needed for a 3% MDE, unadjusted
184,000 per arm

CUPED on the pre-period covariate removes the 43%; winsorising at the 99th percentile removes most of the 29%. Together the required sample falls from 184,000 to about 60,000 per arm.

Two thirds of this metric's variance had nothing to do with the experiment. The stable user differences are the largest single block and the easiest to remove, because a user's own history predicts it — that is exactly what CUPED subtracts. The top 1% of orders is the second block and the more delicate one: winsorising removes it, and it also changes what you are measuring, since a treatment that genuinely produces very large orders would now be partly invisible. That is an acceptable trade for most conversion-oriented tests and a bad one for a test aimed at high-value customers, which is why the decision belongs in the design document rather than in the analysis. The threefold reduction in sample is what a fortnight instead of six weeks looks like.

Common misconceptions

Variance and standard deviation are interchangeable.
They carry the same information and behave differently in arithmetic. Variance adds across independent sources and standard deviation does not, so derivations use variance; standard deviation is in the data's units, so reporting uses that. Sample size scales with variance, which is why halving the standard deviation quarters the traffic needed rather than halving it.
High variance means the experiment is badly designed.
Usually it means the metric is genuinely variable, which is a property of customer behaviour rather than a fault. What it does mean is that the design has to account for it — more observations, a less volatile metric, or variance reduction. Treating it as a data-quality problem leads to filtering that introduces selection bias instead.
We should remove outliers to reduce variance.
Winsorising or capping is often justified, and it must be decided before seeing results and applied identically to every arm. Deciding after the fact which extreme values to drop is choosing the answer, and dropping them entirely rather than capping them throws away information about a real part of the business.

Frequently asked questions

Why square the deviations instead of taking absolute values?
Mostly because squaring makes the mathematics work. Squared deviations are differentiable everywhere and produce closed-form solutions, which is why least squares has a formula and least absolute deviations needs an optimiser. Variance also adds across independent sources, which absolute deviation does not. The mean absolute deviation is a perfectly reasonable descriptive measure and simply does not compose into a theory.
How do I reduce variance in an experiment?
Start by working out where it comes from. Stable differences between users are usually the largest block and are removable with a pre-experiment covariate. Day-of-week and seasonal structure can be removed by design or by stratification. A heavy tail can be capped or winsorised. And triggering the analysis at the point of exposure removes users who could not have been affected, which reduces dilution as well as variance.
What does variance explained mean in a model?
It is the share of the total variance in the outcome that the model accounts for, which is what R-squared reports. It is a statement about this sample and about association, not about causation or about levels — a variable can explain little variance while contributing a great deal to the outcome, if it barely varied over the period observed.

Related terms

  • CUPED

    Use pre-period data to strip out noise — the same test, 20-50% less traffic, no change to the estimate.

  • Normal distribution

    The bell curve — and why your skewed revenue data usually does not break the test anyway.

  • Outlier

    The extreme value that decides your result — and why the rule for handling it must precede the data.

  • Overfitting

    A model that memorised the noise — excellent on the data it saw, useless on the data it will meet.

  • R-squared

    Share of variance explained — the most quoted and most over-interpreted number in any model output.

  • Standard deviation

    How spread out the data are, in the data's own units — and the reason some metrics need vastly more sample.

  • Standard error

    How much your estimate would move if you ran the study again — precision, not spread.

Calculate it

  • Two-sample t-test

    Compare the average of two independent groups — plan the sample size, then test the result.

  • A/B test sample size

    Size a two-proportion experiment before you launch, then read the lift and its interval once it lands.

  • One-way ANOVA

    Three or more independent groups on one continuous outcome — size it, then run the F test.

Knowing the term is the easy part

Applying it to a live measurement problem is the part that goes wrong. If you are designing an experiment, reading a result you do not trust, or trying to work out what your marketing actually caused, that is the work we do.