Sample Variance Calculator

Instructions: Use this Sample Variance Calculator to compute, showing all the steps the sample variance \(s^2\), using the form below:

X values (comma or space separated) =
Name of the random variable (Optional)

The Sample Variance

The sample variance \(s^2\) is one of the most common ways of measuring dispersion for a distribution. When a sample of data \(X_1, X_2, ...., X_n\) is given, the sample variance measures the dispersion of the sample values with respect to the sample mean.

How do You compute the sample variance?

More specifically, the sample variance is computed as shown in the formula below:

\[ s^2 = \displaystyle \frac{1}{n-1} \sum_{i=1}^n (X_i - \bar X)^2 \]

The above formula has the sum of squares \( \sum_{i=1}^n (X_i - \bar X)^2 \)on the top and the number of degrees of freedom \(n-1\) in the bottom.

The way you use the above formula is simple:

  • You set a table, with one column for the data given \(X_i\)
  • You compute the sample mean \(\bar X\)
  • Put the sample mean in a column next to the \(X_i\) data (put the sample mean next to EACH term of the sample)
  • Construct a column where you compute the subtraction of the sample data and the sample mean: \(X_i - \bar X\)
  • Construct a column where you compute the square of the previous column: (\(X_i - \bar X\))^2
  • Add up the values of this last column
  • Divide the result you found by \(n-1\).

How do you calculate the sample variance using Excel?

Observe that you need to compute the sample mean \(\bar X\) first in order to use the above formula. You can compute the variance using Excel by using the =VAR() function, but the advantage of ours is that it is a variance calculator with steps. Also, notice that if you take the square root of the variance, what you get is the sample standard deviation.

A More Operational Form

People complain that in order to compute the variance they need to go and first compute the sample mean, and the after they need to compute the deviations, and all that. But, is there a way to calculate the sample variance right away, without computing the sample mean?

You bet there is. Often times people think they need to use the mean and variance formula mandatorily, but that is not the case. You can check below the way to compute the sample variance directly, without computing the sample mean

\[ s^2 = \displaystyle \frac{1}{n-1} \left( \sum_{i=1}^n X_i^2 - \frac{1}{n}\left(\sum_{i=1}^n X_i \right)^2 \right) \]

Reasons why the sample variance is useful

  • For large sample sizes, the sample variance is a good estimator of the population variance

Descriptive Statistics Calculators you may need

If instead, you want to get a step-by-step calculation of all descriptive statistics, you can try our descriptive statistics calculator , which will provide you with all the most common descriptive statistics, with measures of central tendency and dispersion showing all the steps of the calculation.

Also, if you interested in relative dispersion, as opposed to absolute dispersion, you can use our coefficient of variation calculator , which tells you how large is the dispersion relative to the mean . Why do you need this? Because the standard deviation represents what is considered absolute dispersion. But how large the dispersion is will be relevant only in terms of how large it is relative to the mean.

Sample Variance

Application Example

Question: For the given sample data: 3, 4, 2, 3, 1, 4, 4, 4, 7, 8, 9, 12, 2, 3, 13, 18, compute the sample variance.


We need to compute the sample variance. These are the sample data that have been provided:


Now, we need to square all the sample values as shown in the table below:

Observation: \(X\) \(X^2\)
1 3 9
2 4 16
3 2 4
4 3 9
5 1 1
6 4 16
7 4 16
8 4 16
9 7 49
10 8 64
11 9 81
12 12 144
13 2 4
14 3 9
15 13 169
16 18 324
Sum = \(97\) \(931\)

Therefore, the sample variance is computed as shown below:

\[ \begin{array}{ccl} s^2 & = & \displaystyle \frac{1}{n-1} \left( \sum_{i=1}^n X_i^2 - \frac{1}{n}\left(\sum_{i=1}^n X_i\right)^2 \right) \\\\ \\\\ & = & \displaystyle \frac{1}{16 - 1} \left( 931 - \frac{97^2}{16} \right) \\\\ \\\\ & = & 22.8625 \end{array}\]

Therefore, based on the data provided, the sample variance is \(s^2 = 22.8625 \).

log in to your account

Don't have a membership account?

reset password

Back to
log in

sign up

Back to
log in