How To Calculate Variance:
- Definition: A measure of the spread of a set of data. It is the average of the squared differences between each value in a sample or population and the mean of that sample or population.
- Step by Step Examples:
Example 1 (Sample Variance):
- Consider a sample of heights of 5 people, where the heights are 170, 175, 180, 185, and 190 cm.
- Calculate the mean of the sample, x̄ = (170 + 175 + 180 + 185 + 190) / 5 = 178 cm.
- Subtract the mean from each value in the sample and square the result: (170 – 178)^2 = (-8)^2 = 64, (175 – 178)^2 = (-3)^2 = 9, (180 – 178)^2 = (2)^2 = 4, (185 – 178)^2 = (7)^2 = 49, (190 – 178)^2 = (12)^2 = 144.
- Sum the squared differences: 64 + 9 + 4 + 49 + 144 = 270.
- Divide the sum by n-1, where n is the number of values in the sample: 270 / (5-1) = 270 / 4 = 67.5.
- The sample variance is 67.5.
Example 2 (Population Variance):
- Consider a population of heights of 10 people, where the heights are 160, 165, 170, 170, 175, 180, 182, 185, 190, and 195 cm.
- Calculate the mean of the population, μ = (160 + 165 + 170 + 170 + 175 + 180 + 182 + 185 + 190 + 195) / 10 = 176 cm.
- Subtract the mean from each value in the population and square the result: (160 – 176)^2 = (-16)^2 = 256, (165 – 176)^2 = (-11)^2 = 121, (170 – 176)^2 = (-6)^2 = 36, (170 – 176)^2 = (-6)^2 = 36, (175 – 176)^2 = (-1)^2 = 1, (180 – 176)^2 = (4)^2 = 16, (182 – 176)^2 = (6)^2 = 36, (185 – 176)^2 = (9)^2 = 81, (190 – 176)^2 = (14)^2 = 196, (195 – 176)^2 = (19)^2 = 361.
- Sum the squared differences: 256 + 121 + 36 + 36 + 1 + 16 + 36 + 81 + 196 + 361 = 918.
- Divide the sum by N, where N is the number of values in the population: 918 / 10 = 91.8.
- The population variance is 91.8.
Variance Calculator
Variance Calculator
Standard Deviation Calculator
To calculate the standard deviation of a set of data, you can use the following formula:
Sample Standard Deviation:
s = sqrt(∑(x_i - x̄)^2 / (n - 1))
where x_i represents each data point, x̄ represents the mean of the data, n represents the number of data points, and ∑ represents the sum of all the differences.
Population Standard Deviation:
σ = sqrt(∑(x_i - μ)^2 / N)
where μ represents the mean of the population, N represents the number of data points in the population, and the other variables are defined as in the sample standard deviation formula.
In both cases, you first need to find the mean of the data, then subtract each data point from the mean, square the result, sum all the squared differences, and divide by either n - 1 for the sample standard deviation or N for the population standard deviation. Finally, take the square root of the result to get the standard deviation.
Deference between Variance and standard deviation
Variance | Standard deviation | |
Definition | A measure of the dispersion of a set of values from their mean | The square root of the variance |
Formula | Sum of the squared differences between each data point and the mean, divided by the number of data points | Square root of variance |
Unit | Square of the unit of measurement | Same unit of measurement as the data |
Interpretation | Describes how spread out the data is, relative to the mean | Describes how spread out the data is, in the same unit as the data |
Example | A variance of 4, in data measured in inches, means the data is spread out 4 square inches away from the mean | A standard deviation of 2 in data measured in inches means the data is spread out 2 inches away from the mean |