If you look on the packaging of most of the food and drink you buy you will see that it includes a weight or volume for the amount that you can expect to find and also a specifically formatted letter e. We will talk about the meaning of the e-symbol later but first we want to ask a question and make some measurements.
The Question
I have bought some chocolate bars and I want to know where they actually do weight the amount specified on the packet or if the company that makes them is selling them underweight. This is a very old question and a long standing problem. I want to know if it is an honest seller.
I can check the weight of the chocolate bars by unwrapping the bars and weighing them. This is a simple experiment. I took the kitchen scales and measured the weights of the chocolate bars.
The Wispa Bars
First I weighted the Wispa bars on the kitchen scales. There were four bars in the packet with the following weights:
28.0g, 29.0g, 28.5g, 29.0g
What do you notice about these measurements?
They are all larger than the weight on the packet.
The numbers seem to only finish with .0 and 0.5.
The second point needs addressing first. Although the kitchen scales have a single decimal point it seems that their procession is only to the nearest 0.5g. If we are going to compare the results to a predicted value of 27.9g then we need scales with a larger number of decimal places and these scales are inadequate.
This is a a fundamental issue with ANY data collection. You need to know what is the level of precision for the data collection. This will usually be defined by the tool that you use to make the measurement.
What you are measuring will also determine how easy it is to measure. Weights can be measured to 0.00005g in a chemical laboratory. Micro-pipettes allow for the measurement of volumes to microlitres, but a tape measure or ruler is only going to measure to nearest half-milllimetre at best. Always question data where there are a large number of decimal places that is not compatible with the equipment used.
If I repeat the measurement with a new set of scales that give measurements to 0.01g then I can compare them to the predicted value of 27.9g
On this new scale my measurements are:
28.39g, 28.94g, 28.64g, 28.77g.
Again all of the measurements are above the predicted value but now I have measurements that are precise enough to compare with the predicted value.
Precision and Accuracy
These are two terms that I need to discuss further before we look at what the results mean. As I have mentioned precision. These two concepts are very easily confused and even in the peer reviewed literature you will find examples where scientists have mistaken precision for accuracy.
The kitchen scales were not precise enough. They could not give results to one decimal place when I needed at least this level of precision to make a fair comparison. Precision tells you about how much variation there is between measurements and how many decimal places you can use to specify the results.
Accuracy is how far you are from the correct value. An accurate result would be 27.9g as that has been specified as what the weight should be. For a more complete discussion of precision and accuracy see section 3.
Summarising the Data
We have four numbers but we would like to summarise the result as a single value. This will be the centre of the data that we collected. There are several different ways of doing this.
You can arrange the data in ascending order and pick the middle value (for an odd number of data-points) or the mid-point between the two central values (for even numbers of data points). This is the median.
Alternatively you can sum all of the values and divide by the number of measurements. This is the arithmetic mean.
| Kitchen Scale |
28.0 |
28.5 |
29.0 |
29.0 |
| Precise Scale |
28.39 |
28.64 |
28.77 |
28.94 |
Median: Kitchen Scale = 28.75g (the midpoint between 28.5 and 29.0)
Median: Precise Scale = 28.705g (the midpoint between 28.64 and 28.77)
Mean: Kitchen Scale = (28.0 + 28.5 + 29.0 + 29.0 )/4 = 28.625g
Mean: Precise Scale = (28.39 + 28.64 + 28.77 + 28.94)/4 = 28.685g
All of these values are above 27.9g and all the measured values are above 27.9g.
It looks like we are getting a good deal and that the seller is actually giving us more than suggested on the packaging. It is a small sample of only four bars in a single packet and it might not be true in general. It also might just be a single manufacturer Cadbury being generous. If we weight the chocolate bars of another company is this finding still true?
The Mars Bars
This time I only used the precise scales. The measurements were:
42.97g, 43.08g, 43.26g, 43.18g, 37.93g, 39.62g, 39.80g, 40.18g.
These are bars from two different packets of four.
What are your first thoughts about these measurements?
There is a lot more variation than in the Wispa data.
There seems to be more variation between packets than within packets.
Only a single measurement is below the predicted value from the packaging but that is quite a long way below and it is a long lighter than all the other bars.
Median: 41.575g
Mean: 41.2525g
Again both the mean and median are above the expected value from the packaging and most bars weigh more than expected except for a single case. The total of the weight for the second packet is 157.53g which is less than the 157.6 expected value. This suggests that with packets of Mars bars sometimes you get lucky and get a lot more than expected and sometimes you get unlucky and you very slightly less (0.07g is a tiny difference). But it is not a symmetric difference, you are more likely to get more than to get less.
The Generosity of Confectioners
Are chocolate makers really being generous with their customers? Do their machines always add a little bit extra?
From the factory even with quality control not every bar will come off the production line weighing exactly the same amount. Some will be lighter and some will be heavier. Large differences should be less common than small differences and the average difference should be centered on an average weight (in this case more than the desired weight specified on the packaging).
Why are the machines set to a weight above that specified on the packet so that the actual packet weight is towards the bottom end on the range of weights the machine will produce?
This comes from an asymmetry of consequences. If customers think they are being cheated then they are less likely to purchase from that seller in the future, whereas if they think they are getting a good deal they are likely to become repeat customers. Legally there might also be consequences. In medieval times the consequences were more severe and could result in fines or even corporal punishment such as the loss of a hand. Bakers made sure that they would not be fined for selling under-weight goods by adding an extra loaf which is why we have the baker’s dozen.
Today the consequences are loss of reputation for your brand and it can be worth adding a little extra to make sure that you are always above weight.
This is an example of how human behaviours can impact statistics. Kahneman and Tversky showed how behavioural effects play a role in critical thinking and they also play a role in statistics. You need to be aware of the possible fallacies in statistical reasoning.
Reflection
Looking back at the experience of asking the question, making the measurements and then seeing how the data answered the question you can see that there is a lot going on in what on the surface looks to have been a simple example. Based on the data you have discovered something about the behaviour of chocolate manufacturers and the way that the machines work in their factories.
The packaging uses the special e-symbol (\(\textestimated\)) which stands for estimated. The manufacturers can never know the actual weight of every chocolate bar but they should meet at least the average value defined by the \(\textestimated\) on the packet.
You have also seen examples of the precision and accuracy and you have your first experiences of the error distribution. All of this adds to your understanding of how data works and how data analysis should be carried out. It is this depth of understanding and feel for data that makes an effective data scientist, not the power of the computing platform that you are using.