Coefficient of variation and changing every value ·… | StemPy Lab
Course 17.2·Lesson 1 of 3
Coefficient of variation and changing every value
The standard deviation depends on the size of the numbers, so two data sets in different units cannot be compared by it. The coefficient of variation divides the spread by the mean. This lesson also shows what happens to the mean and the spread when every value is shifted or scaled.
about 30 min1 simulation1 practice question
Lesson 1 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
compare the steadiness of two data sets with the coefficient of variation;
say when the coefficient of variation should not be used;
find the new mean and spread when every value is shifted, scaled or both.
Which one is more steady?
A bakery bakes small cakes and big cakes. The small cakes have a mean mass of 250g with a standard deviation of 15g. The big cakes have a mean mass of 1000g with a standard deviation of 40g. The big cakes have the larger standard deviation. But a 40g miss on a cake of 1000g is a small share, and a 15g miss on a cake of 250g is a bigger share. Which batch is more consistent? To decide, we compare the spread relative to the mean.
The coefficient of variation
The coefficient of variation is
CV=xˉσ×100%,xˉ=0.
It has no unit, so it can compare data in different units. The data set with the smaller CV is more consistent. Here:
small cakes: 25015×100=6%;
big cakes: 100040×100=4%.
The big cakes are more consistent, even though their standard deviation is larger.
When not to use it. The coefficient of variation makes sense only when a value of zero means "none of it", as with mass, length or time. It is meaningless for a temperature in degrees Celsius, because 0∘C is not "no temperature". The same data would give a different CV in kelvin. It is also useless when the mean is close to zero. A-Level, IB and AP courses seldom use the CV. Some call it the relative standard deviation.
Changing every value
A teacher adds 5 bonus marks to every paper. A shop converts every price from one currency to another. A thermometer reads 2∘C too high. In each case, every value x becomes a new value y=ax+b. We can find the new mean and spread from the old ones, without redoing the data.
Adding b to every value. Everything moves along the number line together, so the mean moves by b, and so does the median. The distances between values do not change. So the range, the mean deviation, the variance and the standard deviation stay the same.
Multiplying every value by a. All the distances are multiplied by ∣a∣. The mean is multiplied by a. The standard deviation and the mean deviation are multiplied by ∣a∣, and the variance is multiplied by a2.
Both. For y=ax+b,
yˉ=axˉ+b,σy=∣a∣σx,σy2=a2σx2.
The absolute value matters because a spread is never negative. If a=−2, the data are reflected and stretched by 2, and the standard deviation is multiplied by 2, not −2.
Two dot plots on one number line from 0 to 50. The top plot shows the five readings 2, 4, 6, 9 and 14, with a red marker at their mean 7 and a green bar of length 8.39 centred on it, which is two standard deviations wide. The bottom plot shows the same readings after each is multiplied by 3 and increased by 5, which are 11, 17, 23, 32 and 47. Its mean marker is at 26 and its green bar is 25.17 long, three times as long as the bar above.
The coefficient of variation behaves in its own way. Multiplying by a multiplies the mean and the standard deviation by the same factor, so the CV does not change. Adding b changes the mean but not the standard deviation, so the CV changes.
A worked example
A class has marks out of 50 with mean 36 and standard deviation 5. The marks are scaled to be out of 100 by multiplying by 2. Then 4 bonus marks are added.
After scaling. The mean is 72 and the standard deviation is 10. The CV is 7210×100=13.89%, the same as before, since 365=0.1389.
After the bonus. The mean is 72+4=76, and the standard deviation is still 10.
The new CV.7610×100=13.16%. It is smaller, because the same spread now sits on a larger mean.
Practise with new numbers
Try it in Python
The first program finds the coefficient of variation of the two batches of cakes. The second multiplies and shifts a small data set and compares the new mean and standard deviation with the predictions.
Common mistakes
Adding b to the standard deviation. Adding the same number to every value does not change the spread.
Forgetting the absolute value. A standard deviation is never negative, so multiply by ∣a∣.
Multiplying the variance by a. The variance is multiplied by a2.
Using the CV for temperature in degrees Celsius. It is not meaningful there.
Choosing the larger standard deviation as the less steady one. Compare the CV, not the standard deviation, when the means differ.
Remember these
CV=xˉσ×100%. The smaller CV means the more consistent data.
For y=ax+b: yˉ=axˉ+b, σy=∣a∣σx, σy2=a2σx2.
Adding a number leaves every measure of spread unchanged.
Multiplying leaves the CV unchanged. Adding does not.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A data set has mean 80 and standard deviation 12. Find the coefficient of variation.
The values have mean 12 and standard deviation 3. Each value is increased by 6. Find the new mean and standard deviation.
The values have mean 12 and standard deviation 3. Each value is multiplied by −2. Find the new mean, standard deviation and variance.
Why can we not decide, from the standard deviations alone, whether the heights in centimetres or the masses in kilograms of a group of students are more variable?
Temperatures in a town have mean 25∘C and standard deviation 4∘C. Find the mean and the standard deviation in degrees Fahrenheit, using F=1.8C+32.
References
OpenStax, Introductory Statistics, Chapter 2, section on measures of the spread of the data.
NCERT, Mathematics for Class XI, Chapter 13 (Statistics), section on analysis of frequency distributions (the coefficient of variation).
Enroll free in Comparing and Combining Data
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.