Home / Statistics

Mean, Variance and Standard Deviation

The mean says where the data sits; variance and standard deviation say how far it spreads. Drag points around and watch all three respond — then see why one outlier can wreck them.

Controls

number of points8

Drag any point on the plot to change the data.

Data, Mean and Spread

drag the points

Live Calculation

mean μ
0
variance σ²
0
std dev σ
0
within 1σ
0

Overview

Calculate the summaries

For values x₁,…,xₙ, the mean is x̄ = Σxᵢ/n. Population variance averages squared deviations from the population mean. For a sample, the usual unbiased estimator of population variance divides by n−1:

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

For 2, 4, and 6, the mean is 4 and the squared deviations sum to 8. The population variance is 8/3; the sample variance is 4. The sample standard deviation is √4 = 2, in the same units as the data.

Mean, Variance and Standard Deviation

The mean locates a dataset’s centre; variance and standard deviation describe its spread.

Why use n−1?

When the sample mean is estimated from the same observations, deviations around it are constrained to sum to zero. Dividing by n−1 corrects the average squared deviation so it is unbiased for population variance under independent, identically distributed sampling with finite variance. It does not make the sample standard deviation unbiased in general.

Variance and standard deviation are sensitive to outliers because deviations are squared. Compare with median and quantiles, and see expectation and variance for the random-variable definitions.

Understand the units and the denominator

Population variance and sample variance answer different questions. If 2, 4, and 6 are the complete population, their deviations from 4 are −2, 0, and 2. Squared deviations sum to 8; divide by 3 to get population variance 8/3. If these are a sample used to estimate a larger population's variance, the usual estimator divides by n−1 and gives 4. The corresponding standard deviations are √(8/3)≈1.63 and 2. Use the population formula when the complete group is the object of interest; use the sample estimator when drawing an estimate from sampled data under its assumptions.

Variance has squared units, such as hours². Standard deviation takes the square root and returns to the units of the observations. It is not the average absolute distance from the mean, though both measure spread. Because deviations are squared, extreme values have extra influence. For skewed data, report a median and interquartile range alongside or instead of mean and standard deviation. See mean, median, and mode and quantiles.

Try this above

Add a constant to every data point, then multiply every point by the same factor. Check how the mean and spread respond.

If every measurement is converted from metres to centimetres, the mean and standard deviation are multiplied by 100, while variance is multiplied by 10,000. Adding 5 to every value raises the mean by 5 but leaves variance and standard deviation unchanged. These transformation rules are useful for checking both calculations and units. If comparing spread across quantities with different means and units, a coefficient of variation may be considered for positive ratio-scale data, but it becomes unstable near a zero mean and is not suitable for every context.

If the data are a sample, n−1 corrects the expected value of the sample variance under independent, identically distributed observations with finite variance. It does not account for clustering or unequal selection probabilities. If the sample is weighted or the design is complex, a survey-specific estimator may be required. State whether the values describe a complete population or estimate one; this choice determines which denominator is meaningful.

Sources and next steps

Predict, then reveal

About to run: Continue with sampling distributions to distinguish data spread from uncertai.... Before it does — what happens to the readout?

Committing to an answer first is the point — the reveal runs the experiment on the visualisation above and reads the real value back, so nothing here is scripted.

Check yourself

0 of 3

Answer without scrolling back up.

  1. Every value in a dataset is increased by 10. What happens?

  2. Why is standard deviation usually quoted rather than variance?

  3. A single extreme outlier is added to a dataset. Which is affected more?

Cheat sheet

Mean, Variance and Standard Deviation

Measure centre with the mean and spread with variance and standard deviation — the two numbers every normalisation layer uses.

MATHS · vizlearn.in/maths/mean_variance_standard_deviation.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.