Variance Calculator Formula
Understand the math behind the variance calculator. Each variable explained with a worked example.
Formulas Used
Population Variance
pop_variance = ss / 5Sample Variance
samp_variance = ss / 4Mean
data_mean = mnVariables
| Variable | Description | Default |
|---|---|---|
v1 | Value 1 | 4 |
v2 | Value 2 | 8 |
v3 | Value 3 | 6 |
v4 | Value 4 | 5 |
v5 | Value 5 | 7 |
mn | Derived value= (v1 + v2 + v3 + v4 + v5) / 5 | calculated |
ss | Derived value= pow(v1 - mn, 2) + pow(v2 - mn, 2) + pow(v3 - mn, 2) + pow(v4 - mn, 2) + pow(v5 - mn, 2) | calculated |
How It Works
How to Calculate Variance
Population Variance
sigma^2 = Sum of (xi - mean)^2 / N
Sample Variance
s^2 = Sum of (xi - mean)^2 / (n - 1)
Variance measures the average squared distance of each data point from the mean. The sample variance divides by (n-1) instead of n to correct for the bias introduced by estimating the population mean from the sample (Bessel's correction).
Worked Example
Find the variance of 4, 8, 6, 5, 7.
v1 = 4v2 = 8v3 = 6v4 = 5v5 = 7
- 01Mean = (4 + 8 + 6 + 5 + 7) / 5 = 30 / 5 = 6
- 02Squared deviations: (4-6)^2=4, (8-6)^2=4, (6-6)^2=0, (5-6)^2=1, (7-6)^2=1
- 03Sum of squares = 4 + 4 + 0 + 1 + 1 = 10
- 04Population Variance = 10 / 5 = 2
- 05Sample Variance = 10 / 4 = 2.5
Ready to run the numbers?
Open Variance Calculator