How it works
Variance is a foundational statistical measurement that quantifies the degree of dispersion or spread in a data set relative to its mean. In statistical analysis, probability modeling, financial risk management, and scientific research, calculating variance represents the vital step of determining how widely individual observations vary from the expected central value.
Sample Variance s² = Σ(x − x̄)² ÷ (n − 1) Population Variance σ² = Σ(x − μ)² ÷ N · Standard Deviation = √VarianceWorked example. Consider the data set: 2, 4, 4, 4, 5, 5, 7, 9. The total sum of the values is 40 and the count is n = 8, producing an arithmetic mean of 5. Calculating each observation’s deviation from 5 and squaring it gives: 9, 1, 1, 1, 0, 0, 4, 16. The sum of squared deviations (Sum of Squares, SS) equals 32. When treated as a sample (using n − 1 = 7 degrees of freedom), the sample variance is 32 ÷ 7 = 4.5714 (with a sample standard deviation of 2.1381). When treated as an entire population (dividing by N = 8), the population variance is 32 ÷ 8 = 4.0000 (with a population standard deviation of 2.0000).
Step-by-step instructions: how to calculate variance by hand
- Compute the mean (average): add all values together and divide by the total number of observations (n).
- Find individual deviations: subtract the calculated mean from each individual data point (x − x̄). The algebraic sum of all deviations always equals zero.
- Square each deviation: multiply each deviation by itself (x − x̄)². Squaring ensures that negative deviations do not cancel out positive deviations.
- Sum the squared deviations: add all squared values together to obtain the Sum of Squares (SS = Σ(x − x̄)²).
- Divide by degrees of freedom: divide the sum of squares by (n − 1) if analyzing a sample, or by N if you possess data for the entire population. The resulting quotient is the variance.
Sample variance vs population variance: Bessel’s correction
Understanding when to use sample variance versus population variance is essential for unbiased statistical inference:
- Population Variance (σ²): applied when your data encompasses every single member of the target group under study (such as all students in a specific classroom, or all manufactured components in a test batch). Here, divide by N.
- Sample Variance (s²): applied when working with a subset or sample selected from a wider population (such as 100 randomly surveyed voters representing a national electorate). Dividing by n − 1 (known as Bessel’s correction) mathematically corrects for the sample's inherent tendency to underestimate true population dispersion.
Variance vs standard deviation: key distinctions
While variance and standard deviation both express dispersion, they serve complementary purposes. Variance is measured in squared units (e.g., dollars squared, centimeters squared), making it mathematically advantageous for regression analysis and analysis of variance (ANOVA). Standard deviation is the square root of variance, returning the measurement to the original data's linear units for intuitive practical interpretation.
To examine standard deviation in detail, visit our standard deviation calculator. To find central tendencies including median and mode, use the average calculator, and to standardize individual scores against the distribution, open the z-score calculator.