Variance Calculator
The variance calculator is a great educational tool that teaches you how to calculate the variance of a dataset. The calculator works for both population and sample datasets.
Read on to learn:
- The definition of variance in statistics;
- The variance formula;
- Examples of variance calculations; and
- A quick method to calculate variance by hand.
What is the definition of variance?
Variance is a measure of the variability of the values in a dataset.
A high variance indicates that a dataset is more spread out.
A low variance indicates that the data is more tightly clustered around the mean, or less spread out.
Learning how to calculate variance is a key step in computing standard deviation. These two measures are the foundation to calculating relative standard deviation and confidence intervals.
π‘ If you want to learn more about the role of variance in statistic, you can read our article: What is Variance in Statistics?.
Not sure about the two last notions we used? Discover them by visiting our dedicated tools: the relative standard deviation calculator and the confidence interval calculator!
Variance formula
Variance (denoted as Ο2) is defined as the average squared difference from the mean for all data points. We write it as:
Ο2=N1ββi=1Nβ(xiββΞΌ)2Ο2=N1ββi=1Nβ(xiββΞΌ)2
where,
- Ο2 is the variance;
- ΞΌ is the mean; and
- xα΅’ represents the ith data point out of N total data points.
You can calculate variance in three steps:
-
Find the difference from the mean for each point. Use the formula: xiββΞΌxiββΞΌ
-
Square the difference from the mean for each point: (xiββΞΌ)2(xiββΞΌ)2
-
Find the average of the squared differences from the mean which you found in step 2: N1ββi=1Nβ(xiββΞΌ)2N1ββi=1Nβ(xiββΞΌ)2
This is the population variance formula. Note, that this formula is slightly different for sample data (see the next section) and for grouped data. In fact, for the latter, we have the dedicated grouped data variance calculator.
Population vs. sample variance formula
In many scientific experiments, only a sample of the population is measured for practical reasons. This sample allows us to make inferences about the population. However, when we use sample data to estimate the variance of a population, the regular variance formula, Ο2=N1ββi=1Nβ(xiββΞΌ)2Ο2=N1ββi=1Nβ(xiββΞΌ)2, underestimates the variance of the population.
To avoid underestimating the variance of a population (and consequently, the standard deviation), we replace N with N - 1 in the variance formula when sample data is used. This adjustment is known as Bessel's correction.
The sample variance formula becomes:
s2=Nβ11ββi=1Nβ(xiββxΛ)2s2=Nβ11ββi=1Nβ(xiββxΛ)2
where,
- s2 is the estimate of variance;
- xΜ (pronounced as "x-bar") is the sample mean; and
- xi is the ith data point out of N total data points.
π‘ Want to learn more? Check out our detailed article: Sample Variance vs. Population Variance: What's the Difference?.
Example calculation
Let's calculate variance of eight students' quiz scores: 5, 5, 5, 7, 8, 8, 9, 9. Follow these steps:
1. Calculate the mean
To calculate the mean (xΜ), divide the sum of all numbers by the number of data points:
x=81β(5+5+5+7+8+8+9+9)x=81β(5+5+5+7+8+8+9+9)
x=7x=7
2. Calculate the difference from the mean, and the squared differences from the mean
Now that we know the mean is 7, we will calculate the difference from the mean using the formula:
xiββxxiββx
The first point has a value of 5, so the difference from the mean is 5 - 7 = -2.
The squared difference (or "squared deviation") from the mean is simply the square of the previous step:
(xiββx)2(xiββx)2
so, the squared deviation would be:
(5β7)2=(β2)2=4(5β7)2=(β2)2=4
We show the calculated squared deviations from the mean for all quiz scores in the table below. The "Deviation" column is the score minus 7, and the "Deviation2" column is the previous column squared.
Score | Deviation | Deviation2 |
|---|---|---|
5 | -2 | 4 |
5 | -2 | 4 |
5 | -2 | 4 |
7 | 0 | 0 |
8 | 1 | 1 |
8 | 1 | 1 |
9 | 2 | 4 |
9 | 2 | 4 |
3. Calculate the variance and standard deviation
Next, we use the squared deviations from the mean we found in step 2 in the variance equation:
Ο2=N1ββi=1nβ(xiββx)2Ο2=N1ββi=1nβ(xiββx)2
Ο2=81β(4+4+4+0+1+1+4+4)Ο2=81β(4+4+4+0+1+1+4+4)
Ο2=2.75Ο2=2.75
The quiz scores' variance was 2.75.
You can learn more about the difference between variance and standard deviation by visiting our page: Variance vs. Standard Deviation: Understanding the Difference.
Note that if we used sample data to estimate the variance of a population, we would use the sample variance equation instead:
s2=Nβ11ββi=1nβ(xiββx)2s2=Nβ11ββi=1nβ(xiββx)2
Now that you know how to find variance, try calculating it yourself, then check your answer using our calculator!
You might find it interesting that variance can be used to calculate the dispersion of data.
How to calculate variance by hand?
If you are calculating variance with a handheld calculator, there is an easier formula you should use. This alternative formula is mathematically equivalent, but easier to type into a calculator.
The easy-to-type formula for variance (for population data) is:
The easy-to-type formula for sample variance is:
For example, with a sample dataset of 1, 2, 4, 6, the calculation for sample variance would be:
Try it yourself, then check your answer with our variance calculator!
Summary of variables and equations
Table 1. Variables for population data
Variable | Symbol | Equation |
|---|---|---|
Population mean | ΞΌ | β(xi) / N |
Sum of squares | SS | β(xi - ΞΌ)2 |
Variance | Ο2 | SS / N |
Standard deviation | Ο | β(Ο2) |
Table 2. Variables for sample data
Variable | Symbol | Equation |
|---|---|---|
Sample mean | xΜ | β(xi) / N |
Sum of squares | SS | β(xi - xΜ)2 |
Sample variance | s2 | SS / (N - 1) |
Standard deviation | s | β(s2) |
FAQs
- What does the Variance Calculator do?
- The variance calculator finds the variance of a set of numbers. It is a measure of how tightly clustered the data is around the mean. Use the calculator above for instant results in your browser.
- Is the Variance Calculator free to use?
- Yes. All Try To Calculator tools are free and do not require an account.
- Are my inputs stored or sent to a server?
- No. Calculations run locally in your browser. We do not collect the numbers you enter or the results shown.
- Can I use the Variance Calculator for professional decisions?
- This tool is for education and quick estimates. For medical, legal, tax, or financial decisions, verify results with a qualified professional.
- Where can I find related calculators?
- Browse more Statistics tools on Try To Calculator at /statistics, or use the related calculators section on this page.
Based on 1 source
- Analysis of Variance (ANOVA) β Iacobucci D.
Related calculators
5β rating average
The rating average calculator returns an average rating based on the number of 1-5 ratings.
Statistics
Dice probability
With this dice probability calculator, you can easily find the various probabilities related to rolling a set of dice.
Statistics
Critical value
The critical value calculator helps you find the one- and two-tailed critical values for the most widespread statistical tests.
Statistics
Coin flip probability
Coin flip probability calculator lets you calculate the likelihood of obtaining a set number of heads when flipping a coin multiple times.
Statistics