What Is Variance and What Does It Measure?
Variance is the core statistical measure of how widely numbers in a dataset scatter around their arithmetic mean. Specifically, variance equals the average of the squared distances between every individual data point and the group center.
When every number in a dataset sits close to the mean, variance stays near zero. When values stretch far above and below average (or even when a single extreme outlier appears), variance jumps dramatically because large distances get amplified when squared. Beyond standing on its own across finance, experimental design, and ANOVA hypothesis tests, taking the square root of variance immediately yields the standard deviation.
Variance Formulas: Sample (s²) vs. Population (σ²)
Choosing between sample variance and population variance comes down to whether your numbers represent a subset drawn from a broader universe or every single observation in the complete group:
Sum of Squares (SS): SS = Σ (xᵢ − Mean)²
Sample Variance (s²): s² = Σ (xᵢ − x̄)² ÷ (N − 1)
Population Variance (σ²): σ² = Σ (xᵢ − μ)² ÷ N
Computational Shortcut (s²): s² = [ Σ xᵢ² − (Σ xᵢ)² ÷ N ] ÷ (N − 1)
- Sample Variance (
s², divide byN − 1): Use this whenever your list is a sample taken from a larger population (for example, 8 blood-pressure measurements from a clinical cohort or 25 product weights sampled off an assembly line). Subtracting 1 applies Bessel's correction so sample variance stays unbiased. - Population Variance (
σ², divide byN): Use this when your dataset contains every individual belonging to the entire group of interest (for instance, all 5 quiz scores in a tiny seminar or all 12 calendar months of a completed fiscal year). - Computational Shortcut: Hand calculators and streaming algorithms often accumulate
Σ xᵢandΣ xᵢ²in a single pass usingSS = Σ xᵢ² − (Σ xᵢ)² ÷ N, avoiding two scans through large arrays.
Why Does Variance Square the Deviations?
Beginners naturally wonder why statisticians bother squaring every difference (xᵢ − Mean)² instead of just averaging the raw distances (xᵢ − Mean). Let's test what happens on our sample list [10, 12, 23, 23, 16, 23, 21, 16] whose mean is 18:
Adding the raw signed deviations gives (−8) + (−6) + (+5) + (+5) + (−2) + (+5) + (+3) + (−2) = 0. By mathematical definition of the arithmetic mean, negative deviations below average and positive deviations above average always cancel out to zero! Squaring turns every gap positive and gives extra weight to faraway points, ensuring outliers signal high dispersion. Better yet, unlike absolute deviations, squared variance obeys clean linear algebra: for independent random variables, Var(X + Y) = Var(X) + Var(Y).
2 Worked Examples
Example 1: Sample Variance of 8 Lab Measurements (N − 1 = 7)
Suppose an experiment records 8 repeat measurements: 10, 12, 23, 23, 16, 23, 21, 16. Calculate the sample variance (s²) and sample standard deviation (s):
- Compute the sample mean (x̄): Sum all 8 numbers to get
144, then divide by8:144 ÷ 8 = 18. - Subtract 18 from each observation and square:
(10 − 18)² = 64,(12 − 18)² = 36,(23 − 18)² = 25(three times =75),(16 − 18)² = 4(twice =8), and(21 − 18)² = 9. - Total the squared deviations (Sum of Squares):
SS = 64 + 36 + 75 + 8 + 9 = 192. Notice how a single point at10accounts for one-third (64 / 192) of total SS! - Divide by
N − 1 = 7:s² = 192 ÷ 7 ≈ 27.428571. Taking√27.428571givess ≈ 5.2372.
Example 2: Population Variance of a Full 5-Score Study Group (N = 5)
Suppose a tutor tracks every member of a 5-person study cohort whose final quiz scores are 72, 78, 80, 84, 86. Because these 5 numbers make up the complete population of interest, compute the population variance (σ²):
- Population mean (μ):
(72 + 78 + 80 + 84 + 86) ÷ 5 = 400 ÷ 5 = 80. - Squared deviations from 80:
(−8)² + (−2)² + (0)² + (+4)² + (+6)² = 64 + 4 + 0 + 16 + 36 = 120. - Divide by full population size
N = 5:σ² = 120 ÷ 5 = 24.0000(with population standard deviationσ = √24 ≈ 4.8990).
Understanding Bessel's Correction (Dividing by N − 1 vs. N)
Why does sample variance divide by N − 1 rather than N? Because the sample mean x̄ is calculated from those exact N numbers, it naturally sits slightly closer to those sampled points than the unseen true population mean μ does. If you divided by N on a small sample, your estimate of population spread would consistently come out too small.
Replacing N with N − 1 degrees of freedom removes that downward bias mathematically so E[s²] = σ². As sample size grows larger, the relative adjustment between dividing by N − 1 and N shrinks rapidly toward zero.
| Sample Size (N) | Degrees of Freedom (N − 1) | Sample / Population Ratio | Relative Adjustment | Practical Guidance |
|---|---|---|---|---|
| N = 2 | 1 | 2.000× | +100.0% | Minimum size for sample variance; huge sensitivity to noise |
| N = 5 | 4 | 1.250× | +25.0% | Common pilot experiment; N − 1 essential |
| N = 8 | 7 | 1.143× | +14.3% | Noticeable gap between s² (27.43) and σ² (24.00) |
| N = 20 | 19 | 1.053× | +5.3% | Moderate sample; keep N − 1 standard |
| N = 50 | 49 | 1.020× | +2.0% | Small difference in point estimates |
| N = 100 | 99 | 1.010× | +1.0% | Sample and population metrics nearly match |
Key Mathematical Properties of Variance
Three algebraic rules explain why variance dominates statistics, probability, and portfolio math:
- Adding a Constant Changes Variance Zero Percent (
Var(X + c) = Var(X)): Adding+10bonus points to every student's exam raises the class mean by 10, but the distances between each score and the mean stay identical, so variance stays unchanged! - Multiplying Data Scales Variance by the Square (
Var(aX) = a² × Var(X)): Converting measurements from meters to centimeters (× 100) multiplies standard deviation by100, which multiplies variance by100² = 10,000! Watch unit conversions carefully when reporting variance. - Additivity Across Independent Sources (
Var(X ± Y) = Var(X) + Var(Y)): Whether adding or subtracting two independent error terms or random payouts, their variances add directly together. You cannot add standard deviations directly without squaring into variance first!
Real-World Applications of Variance
Variance drives critical models across finance, science, and engineering:
- Portfolio Risk & Modern Portfolio Theory: Financial analysts compute the variance of daily or monthly asset returns (
σ²) and asset covariances to build diversified portfolios that minimize variance for a target expected return. - ANOVA (Analysis of Variance) & A/B Testing: Experimental statisticians partition total Sum of Squares (
SS) into within-group variance and between-group variance to determine whether two website layouts or drug treatments differ beyond random noise. - Quality Control & Manufacturing Six Sigma: Engineers track process variance to verify tolerances stay narrow enough that defect rates remain below parts-per-million thresholds.
- Machine Learning Loss & Bias-Variance Tradeoff: Model builders inspect prediction variance across cross-validation folds to detect overfitting before deploying models into production.
Variance Formulas in Excel, Google Sheets & Python
Put your dataset values into column A2:A9 and run these built-in spreadsheet or code functions:
Excel / Sheets Population Variance (N): =VAR.P(A2:A9)
Sum of Squares of Deviations (SS): =DEVSQ(A2:A9)
Python (statistics module): statistics.variance(data) | statistics.pvariance(data)
5 Common Variance Mistakes to Avoid
- Forgetting That Variance Uses Squared Units: If your input list measures prices in dollars (
$), variance is reported in squared dollars ($²), not dollars. Take the square root (Standard Deviation Calculator) whenever interpreting spread in original units. - Dividing by
Nfor Small Samples: UsingVAR.Pon a 6-trial lab sample systematically underestimates true variability by nearly 17%. Use Sample mode (N − 1) unless you possess every single record in the population. - Using Sample Variance on 1 Number: With
N = 1, the denominatorN − 1 = 0makes sample variance undefined (0 / 0). You need at least 2 sample values to measure spread around a mean. - Adding Standard Deviations Without Squaring Into Variance First: Two independent assembly tolerances with
σ₁ = 3andσ₂ = 4combine to variance3² + 4² = 25(giving combinedσ = 5, not7!). - Ignoring Sensitivity to Outliers: Because deviations get squared, one data entry sitting 10 units away from the mean contributes 100 times more to Sum of Squares than a point sitting 1 unit away! Always glance at our squared-deviation bar chart to spot whether one data point dominates total variance.
Related Statistics & Math Calculators
Combine variance with companion calculators across our Math & Statistics hub:
- Standard Deviation Calculator: view the interactive bell curve, ±1 SD / ±2 SD normal zones, SEM, and coefficient of variation.
- Percent Error Calculator: evaluate experimental bias and laboratory accuracy against a known true reference.
- Percentage Difference Calculator: measure symmetric spread between two peer observations.
Learn how Staticnexa tests statistical algorithms and edge-case validation in our Editorial & Mathematical Accuracy Policy.
Frequently Asked Questions
What is the difference between variance and standard deviation?
Variance measures the average of squared deviations from the mean and is expressed in squared units (such as dollars squared or meters squared). Standard deviation is simply the positive square root of variance, returning spread back into the same units as your original data.
When should I use sample variance (N - 1) vs. population variance (N)?
Use sample variance (N - 1) when your dataset is a subset drawn from a wider population, which applies Bessel correction to prevent underestimating spread. Use population variance (N) only when you have recorded every member of the entire group of interest.
Can variance ever be negative?
No. Because every deviation (xi - Mean)^2 is squared before summing and dividing by a positive denominator, variance is always 0 or greater. Variance equals 0 only when every number in the dataset is identical.
What is Sum of Squares (SS) in variance?
Sum of Squares (SS) is the numerator of the variance formula: the sum of all squared differences between each data value and the mean. Dividing SS by N - 1 gives sample variance; dividing SS by N gives population variance.
Why does Excel have VAR.S and VAR.P?
VAR.S computes sample variance by dividing by N - 1 (matching standard statistical sampling), whereas VAR.P computes population variance by dividing by N.
What happens to variance if I add 10 to every number in my list?
Nothing changes! Adding a constant shifts the mean by the exact same constant, leaving all distances (xi - Mean) and therefore variance unchanged.
Mathematical References & Standards
- OpenStax Introductory Statistics (2e): Section 2.7: Measures of the Spread of the Data (Textbook derivation of sample variance (s²), population variance (σ²), and deviations from the mean)
- NIST Engineering Statistics Handbook: Section 1.3.5.6: Measures of Scale (Variance & Standard Deviation) (Federal statistical reference on scale estimators, Bessel N - 1 denominator, and outlier sensitivity)
- Khan Academy: Calculating Variance and Standard Deviation (Worked walkthrough contrasting sample and population variance formulas)
- Wikipedia: Variance: Definition, Properties & Sample Estimation (Mathematical properties (shift invariance, quadratic scaling, independent additivity, and Bessel correction))