Variance Formula
Before learning the variance formula, let us recall what is variance. Variance (σ2) is the squared variation of values (Xi) of a random variable (X) from its mean (μ). The variance formula lets us measure this spread from the mean of the random variable. The variance formula is different for a population and a sample. Let us now look at the variance formula below.
What is Variance Formula?
There are separate variance formulas for the ungrouped data and the grouped data. The variance formulas are mentioned below.
-
For ungrouped data, variance can be written as:
-
Population Variance for population of size N = \(\Sigma\dfrac{(X_i-\bar{X})^2}{N}\)
-
Sample Variance for sample of size N = \(\Sigma\dfrac{(X_i-\bar{X})^2}{N-1}\)
-
-
For grouped data, variance can be written as:
-
Population Variance, for population of size N = \(\Sigma\dfrac{f(M_i-\bar{X})^2}{N}\)
-
Sample Variance, for sample of size N = \(\Sigma\dfrac{f(M_i-\bar{X})^2}{N-1}\)
-
where,
- \(\bar{X}\) is the mean
- \(M_i\) is the mid-point of the ith interval.
Note:
- For ungrouped data, \(\bar{X}\) = \(\dfrac{\Sigma x_i}{N} \)
- For grouped data, \(\bar{X}\) = \( \dfrac{\Sigma M_i f}{\Sigma f} \)
Let us see the applications of the variance formulas in the following solved examples section.
Examples Using Variance Formula
Example 1: Find the variance of the following data using the variance formula: 24, 53, 53, 36, 21, 84, 64, 34, 77, 54
Solution:
Population Size (N) = 10
xi | (xi - x̄) | (xi - x̄)2 |
24 | -26 | 676 |
53 | 3 | 9 |
53 | 3 | 9 |
36 | -14 | 196 |
21 | -29 | 841 |
84 | 34 | 1156 |
64 | 14 | 196 |
34 | -16 | 256 |
77 | 27 | 729 |
54 | 4 | 16 |
μx = \( \frac{\Sigma x_i}{10}= \frac{500}{10} \) = 50 units | σx = \( \frac{\Sigma (x_i - \bar{x})^2 }{10} = \frac{4084}{10} \) = 408.4 units2 |
Answer: The variance of the given data is 408.4 units2
Example 2: Find the mean and variance for the following data.
Class | 10-20 | 20-30 | 30-40 | 40-50 | 50-60 | 60-70 | 70-80 | 80-90 | 90-100 |
frequency (f) | 2 | 3 | 6 | 8 | 5 | 3 | 6 | 1 | 4 |
Solution:
Let d = (Mi - Midpoint)/10, it is divided by 10 for simplification. (h =10)
Class | f | Midpoint of ith class interval (Mi) | Mif | d | d2 | d2f | df |
10-20 | 2 | 15 | 30 | -4 | 16 | 32 | -8 |
20-30 | 3 | 25 | 75 | -3 | 9 | 27 | -9 |
30-40 | 6 | 35 | 210 | -2 | 4 | 24 | -12 |
40-50 | 8 | 45 | 360 | -1 | 1 | 8 | -8 |
50-60 | 5 | 55 | 275 | 0 | 0 | 0 | 0 |
60-70 | 3 | 65 | 195 | 1 | 1 | 3 | 3 |
70-80 | 6 | 75 | 450 | 2 | 4 | 24 | 12 |
80-90 | 1 | 85 | 85 | 3 | 9 | 9 | 3 |
90-100 | 4 | 95 | 380 | 4 | 16 | 64 | 16 |
\(\Sigma f = 38\) | Midpoint = 55 | \(\Sigma M_i f = 2060 \) | \(\Sigma d^2 f = 191 \) | \(\Sigma df \) = -3 |
Mean = \( \dfrac{\Sigma M_i f}{\Sigma f}\) = \(\dfrac{2060}{38}\) = 54.21 units
Using the variance formula,
Variance = \( \dfrac{\Sigma f d^2 - ( \frac{\Sigma(fd)^2}{n})}{n} h^2 \) = \( (\dfrac{191 - ( \frac{(-3)^2}{38})}{38})10^2 \)
= \( (\dfrac{191 - 0.2368}{38}) 100 \) = 502 units2
Answer: The mean of this data = 54.21 units and the variance of this data = 502 units2
Example 3: Given the following population data, find its population variance.
X | 21 | 42 | 37 | 16 | 31 | 28 | 33 | 41 | 12 |
Solution:
Population Mean = (21+42+37+16+31+28+33+41+12)/9 = 261/9 = 29
Using the population variance formula,
Population Variance = \( \frac{(21 - 29)^2+(42 - 29)^2+(37 - 29)^2+(16 - 29)^2+(31 - 29)^2+(28 - 29)^2+(33 - 29)^2+(41 - 29)^2+(12 - 29)^2}{9} \) = 920/9 = 102.22 units2
Answer: Population variance of the given dataset is 102.22
FAQs on Variance Formula
What is the Difference Between Standard Deviation Formula and Variance Formula?
Variance is the average squared deviations from the mean, while standard deviation is the square root of the variance. Both measures reflect variability in distribution, but their units differ: Standard deviation is expressed in the same units as the original values (e.g., minutes or meters). The sample standard deviation formula is: \(s=\sqrt{\frac{1}{n-1} \sum_{i=1}^{n}\left(x_{i}-\bar{x}\right)^{2}}\) and population variance for population of size N = \(\Sigma\dfrac{(X_i-\bar{X})^2}{N}\)
How do I Calculate the Variance using the Variance Formula?
The variance can be calculated as:
-
Find the mean of the data set. Add all data values and divide by the sample size n.
- Find the squared difference from the mean for each data value. Subtract the mean from each data value and square the result.
- Find the sum of all the squared differences. ...
- Calculate the variance. Population Variance for population of size N = \(\Sigma\dfrac{(X_i-\bar{X})^2}{N}\)
What is Mean-Variance and Standard Deviation in Statistics?
Variance is the sum of squares of differences between all numbers and means...where μ is Mean, N is the total number of elements or frequency of distribution. Standard Deviation is the square root of variance. It is a measure of the extent to which data varies from the mean. The sample standard deviation formula is: \(s=\sqrt{\frac{1}{n-1} \sum_{i=1}^{n}\left(x_{i}-\bar{x}\right)^{2}}\)
Which is Better to Use Variance Formula or Standard Deviation Formula?
They each have different purposes. The SD is usually more useful to describe the variability of the data while the variance is usually much more useful mathematically. For example, the sum of uncorrelated distributions (random variables) also has a variance that is the sum of the variances of those distributions.
visual curriculum