The mean deviation is simple, but absolute values are awkward in later algebra. Squaring the deviations avoids this and leads to the variance and the standard deviation, the most widely used measures of dispersion.
Variance
The variance is the mean of the squared deviations from the mean. For n observations it is the sum of (x - mean) squared divided by n. A shorter formula is the mean of the squares minus the square of the mean. The variance is in squared units, which is why its square root is usually reported.
Definition: Standard deviation. The positive square root of the variance, that is, the square root of the mean of the squared deviations of the observations from their mean.
Standard Deviation
The standard deviation, written s or sigma, has the same unit as the data. A small value shows that the observations are close to the mean, and a large value that they are widely spread. For a sample, the divisor n - 1 is used in place of n to give the sample variance. For grouped data the variance is the sum of f × (x - mean) squared divided by the sum of f.
Properties and Coefficient of Variation
The standard deviation does not change if a constant is added to every observation, but it is multiplied by c when every observation is multiplied by c. To compare the variability of two sets measured in different units or with different means, the coefficient of variation (CV) is used. CV = (standard deviation / mean) × 100, expressed as a percentage. The set with the smaller CV is more consistent.
Table 1.7: Measures of dispersion compared
| Measure | Based on | Affected by extreme values |
|---|---|---|
| Range | Two extreme values | Very much |
| Mean deviation | All values | Yes |
| Quartile deviation | Middle half of the data | No |
| Standard deviation | All values, squared | Yes |
Example 1.7: Variance and standard deviation
Problem: Find the variance and the standard deviation of 4, 8, 6, 5 and 2, and compare the consistency of set A (mean 50, standard deviation 5) with set B (mean 80, standard deviation 10).
Solution:
- The mean is 25 / 5 = 5. The deviations are -1, 3, 1, 0 and -3, and their squares are 1, 9, 1, 0 and 9.
- The sum of squares is 20, so the variance is 20 / 5 = 4 and the standard deviation is 2.
- CV of A = 5 / 50 × 100 = 10 percent. CV of B = 10 / 80 × 100 = 12.5 percent.
Result: The variance is 4 and the standard deviation is 2. Set A has the smaller CV, so it is more consistent.
y = [4, 8, 6, 5, 2]
m = sum(y) / len(y)
v = sum((a - m) ** 2 for a in y) / len(y)
print(m, v, v ** 0.5)
print(5 / 50 * 100, 10 / 80 * 100)
Output
5.0 4.0 2.0
10.0 12.5
Common mistakes
- Forgetting to take the square root, so that the variance is reported as the standard deviation.
- Dividing by n when a sample variance with n - 1 is required.
- Comparing standard deviations of two sets with very different means instead of using the CV.
Key takeaways
- Variance is the mean of squared deviations from the mean.
- Standard deviation is the square root of the variance and has the unit of the data.
- Adding a constant does not change the standard deviation.
- A smaller coefficient of variation means greater consistency.
Practice questions
- Define standard deviation.
- What is the variance of the values 3, 3, 3, 3?
- What is the coefficient of variation?
Answers to the practice questions
- The positive square root of the mean of the squared deviations from the mean.
- Zero, since there is no deviation.
- The standard deviation divided by the mean, multiplied by 100.
Sources
- Official BCA syllabus Probability and Statistics, course code 26BCA403DS01, Unit I
