Last week I saw a link to Forecasting Your Traffic Growth Using Z-Chart, and thought I’d see what it had to say. The claim is that a Z-chart is a method of plotting data for single periods (monthly, for instance), along with cumulative totals (like year to date) and moving totals (12-month rolling total) in order to forecast the quantity being measured.
Sounds good. How does it work?
Construct a table like the one below (the data I used is in z-chart-data.csv). This shows monthly visits for a fictitious web site, along with year to date totals, and a twelve month running total, calculated using of the previous year’s data. (The table in the original article actually computed a 13-month moving average, but I think that was an oversight.)
Here is the data in a Z-chart. Monthly along the bottom, YTD in a diagonal from lower left where it meets Monthly to upper right, and 12-Month Total above the other two until it meets YTD at the top right.
The 12-Month Total shows strong growth, but this chart only shows the second year. We don’t see that the statistics started in January of the previous year with 9 visits. Monthly looks steady, though.
Here is the next year’s data.
Here’s the corresponding Z-chart. Here we see that the chart gets its name from the shape made by the three timelines. Again, Monthly along the bottom, looking as steady as before, YTD again diagonal, and Running Total along the top.
But this Z-chart approach is not as effective as it could be. First let’s show all the data, not just a year at a time. And let’s include a 12-month moving average.
Let’s remove the cumulative (YTD) series. It really doesn’t show anything, but its upward slope, a natural consequence of an increasing value, gives the false impression that all the data is increasing. So it’s best to leave it off. If you want to show month-by-month progress towards a goal, it should be plotted in its own chart.
Now let’s replace the moving total with a moving average. This puts the calculated (smoothed) value into the same axis range as the monthly values. This prevents the large 12-month totals from dwarfing the 1-month individual values.
Here is a non-Z-chart corresponding to the first Z-chart above. Without the distraction of the YTD sloping line, and with the smoothed line and individual values on the same scale, we see that the monthly values are not steady as we first thought, but in fact they experience a bit of variation. There are two important things to note: the moving average is sloping upwards, so web site visits are increasing, and the monthly values exceed the moving average for most of the chart’s duration, also indicating increasing monthly visits.
If we adjust the second Z chart the same way, we see that the moving average is steadily decreasing, indicating fewer monthly visits. The monthly values are mixed, above and below the moving average. If there were a systematic seasonal variation we could see it here, but a cursory look does not reveal a pattern.
The adjusted charting approach doesn’t have a fancy name like “Z-chart”, but it has some advantages:
- Improved clarity: no distracting cumulative timeline makes it look like values are increasing.
- Easier understanding: smoothed and individual values on the same scale makes it easier to see trends in both, variability in the individual values, and deviation of the individual values from the moving average.
There is another advantage:
- Immediate applicability: we can show this data starting from the first month, without waiting to accumulate the first year’s data.
This chart illustrates the immediacy of the simple two-series chart: data starts at the first month.
The first year shows slow but steady growth, the second year shows faster growth, with some variability in the monthly values, and the third year shows a slow decline, with continued variability in the monthly values.
We could try to extend the Z-chart approach to the three-year period, with little success.
The YTD for the first year doesn’t show clearly, and we might notice that YTD for the second year has a slightly steeper slope than YTD for the third year. But YTD is a distraction. The 12-month moving total shows the same shape as our moving average in the previous chart, slow then fast growth, followed by a slow decline. Because of the scale, we’ve lost any insight into the variability of the monthly values.