# Coefficient of variation for shipping

I want to understand if the coefficient of variation ($c_v$) is the right calculation to use for measuring how far off I am when shipping goods to customers. The date I want to ship to customers is the target date and the date I do ship to customers is the ship date.

For my orders, if I took $c_v$ of target date - ship date, would that be a normalized way to measure how far off I am to my target ship dates? Some additional details:

• Some goods take longer than others to produce and get ready to ship
• I want to penalize myself both for shipping early and late. Late is obviously bad. Early is bad too, as I am probably late on something else.

This results in negative numbers in the aggregation (i.e., if I generally ship late), which Wikipedia says was not good for coefficient of variation.

• See e.g. stats.stackexchange.com/questions/118497/… for more discussion of this measure. Note that if everything shipped on time, the mean difference would be zero and you could not even determine the coefficient of variation. That's yet another reason why this measure is not what you want. – Nick Cox Aug 26 '16 at 13:08

The coefficient of variation is defined as the standard deviation divided by the mean. If the mean is negative, then so will the CoV.

Two popular measures would be (root) mean square error and mean absolute error. It's probably easiest to explain with a worked example.

Say you have 5 packages and your values of (target date - ship date) are $4,1,-3,0,-2$ (i.e. 4 days late, 1 day late, 3 days early, on time, 2 days early)

Now the mean happens to be zero, so the CoV would have been infinite!

The mean square error is the mean of $(4^2 , 1^2 , (-3)^2 , 0^2 , (-2)^2)$ which is $30/5=6$. Some people prefer to track the square root of that, but that's just cosmetic.

The mean absolute error is the mean of $(4,1,3,0,2)$ which is 2.

Both options are reasonable; the MSE punishes you more if you occasionally get things very wrong, the MAE is more forgiving.