Statistics
Sample variance
Sum the squared deviations from the sample mean and divide by n minus one. Dividing by four rather than five corrects the bias from estimating the mean from the same data.
Last updated
The Formula
s^2 = sum((x_i - xbar)^2) / (n - 1)
Sum the squared deviations from the sample mean and divide by n minus one. Dividing by four rather than five corrects the bias from estimating the mean from the same data.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| xbar | Sample mean | same as data | The average of the observations, 3.8 for the default values. |
| sum((x_i - xbar)^2) | Sum of squared deviations | squared units | The total of each squared distance from the mean, 4.8 here. |
| n - 1 | Sample degrees of freedom | count | The divisor for the unbiased sample variance, four for five values. |
What Each Symbol Means
xbarsame as data
Sample mean
The average of the observations, 3.8 for the default values.
sum((x_i - xbar)^2)squared units
Sum of squared deviations
The total of each squared distance from the mean, 4.8 here.
n - 1count
Sample degrees of freedom
The divisor for the unbiased sample variance, four for five values.
See It Worked With Real Numbers
A formula on its own does not tell you which number goes where. The how to calculate the standard error page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.
Where This Formula Appears
This equation is the working core of How To Calculate The Standard Error, filed under Math. Every number the guide produces comes from substituting into this one line.
Common Questions
What is the formula for Sample variance?
The formula for Sample variance is s^2 = sum((x_i - xbar)^2) / (n - 1). Sum the squared deviations from the sample mean and divide by n minus one. Dividing by four rather than five corrects the bias from estimating the mean from the same data.
What does each symbol in Sample variance stand for?
xbar is sample mean; sum((x_i - xbar)^2) is sum of squared deviations; n - 1 is sample degrees of freedom.
What units should I use with Sample variance?
Substitute xbar in same as data, sum((x_i - xbar)^2) in squared units, n - 1 as a plain count. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.
What is a common mistake when using Sample variance?
Dividing by n instead of n minus one. The unbiased sample variance divides by four for five values, not by five. Using five produces 0.96 rather than 1.2 here and a slightly smaller standard error. The population divisor is only appropriate when the values are the entire population rather than a sample drawn from one.