# Scaling data that are on different orders of magnitude for plotting

Looking at the following dataset:

 Date        Visits   Carts      carts       Orders
Created   converted    Created
2011-11-11    12277     161        9          36
2011-11-12    11871     93         5          19
2011-11-13    13072     107        8          8
2011-11-14    13594     112        4          34
2011-11-15    12741     129        8          43
2011-11-16    15491     261        16         57
2011-11-17    13418     186        17         42


I've been asked to plot this on a graph, using the Date has the X-Axis and the rest of the data on the Y-Axis. The problem is that the scale of the data is dramatically different. where Visits are in the thousands and Orders Created are in the low tens, the data doesn't plot well on a graph.

I was wondering what a statistician would do in this scenario, I could divide the the Visits by a 1000 and then put in the description (Visits (K)), but then I start to have the same problem with Carts Created, as they are in the hundreds and everything else is in the low tens.

What kind of thing is done in this scenario?

It isn't unreasonable at the onset to plot the line charts as a series of small multiples, with different scales for the Y axis but with the X axis (dates) aligned.

I think this is a good start, as it allows one to examine the raw data, and allows for comparison of trends between different line charts. IMO you should look at the raw data first, then think about conversions or ways to normalize the charts to be comparable after you examine the raw data.

As King has already mentioned, it appears that your variables have a natural ordering based on the names and numbers, and assuming it is appropriate, I created three new variables based on the percentage converted at each state. The new variables are;

% Carts Created = Carts_Created/Visits
% Orders Created = Orders_Created/Carts_Created
% Carts Converted = Carts_Converted/Orders_Created


Making percentages is a way to bring the series closer to a common scale, but even then placing all of the lines on one chart (as below) is still difficult to visualize the series effectively. The level and variation of the orders created and carts converted series dwarfs that of the other series. You can't see any variation in the carts created series on this scale (and I suspect that is the one you are most interested in).

So again, IMO a better way to examine this is to use different scales. Below is the Percentage chart using different scales.

With these graphics, there doesn't appear to me to be any real meaningful correlation to me between the series, but you do have plenty of interesting variation within each series (especially the proportion converted). What's up with 2011-11-13? You had a much lower proportion of order's created but every one of the order's created was a converted cart. Did you have any other interventions which might explain trends in either site visits or proportion or percentage carts created?

This is all just exploratory data analysis, and to take any more steps I would need more insight into the data (I hope this is a good start though). You could normalize the line charts in other ways to be able to plot them on a comparable scale, but that is a difficult task, and I think can be done as effectively choosing arbitrary scales based what is informative given the data as opposed to choosing some default normalization schemes. Another interesting application of viewing many line graphs simultaneously is horizon graphs, but that is more for viewing many different line charts at once.

• Thank you for the detail in your answer, I originally did have multiple charts. My boss's have decided that they would like all the series on the graph (I think its probably too many series but its not me that will be looking at it :) ) I think i'm going to consider looking into normalizing the data, maybe into 0 - 1. They only want to use the graph to view trends, the table data is usually displayed under the graph.
– Mike
Dec 6, 2011 at 15:10
• @Mike, it is a reasonable request. Normalization of the series should not change the trend (just the level and variation of each series). Hopefully you get more insightful answers into how to normalize the series in some effective, but still meaningful ways. Just a word of caution though, typically you only want to plot 3-5 lines on one chart, much more is very difficult to make all of those comparisons (small multiples is a work-around to this problem though). Dec 6, 2011 at 15:19
• @Mike Yes, in this case (just visualizing data without numbers), you can simply express your data on a min/max scale, as is done in parallel displays. Showing numbers below the table is also a good idea.
– chl
Dec 6, 2011 at 15:25
• Just a further note on normalizing to a min/max scale though as @chl suggested. It is good to see the raw data first, if you have some large outlier you may want to consider not including that value in the normalization process (although it should be apparent if you do in the normalized graph, e.g. if you have a line graph with one high/low value and the rest is flat). I think Michael Friendly would agree with including the table below the graph as well. Dec 6, 2011 at 15:40

You can have 2 separate y-axis, Visits (k) and Carts Created in one, the other 2 in another (or whichever way fits your purpose).

This is definitely not an elegant method, but I remember doing it years ago when I just wanted to compare trends across time.

OR

You can just plot the percentage change across time if it suits your purpose.

• I considered the route you mentioned with the 2 different Y axis, but what I didn't like about it was: if a new series was introduced that wouldn't fit on one of the two Y-axis, i would probably be stuck. thank you for the suggestion, and maybe another time i would consider this more :)
– Mike
Dec 6, 2011 at 15:02
• What about the second suggestion about using percentage? i.e. indexing everything at 100 on the start date (or whichever date makes your chart pretty). You can add as many new series as you want!
– King
Dec 6, 2011 at 15:12
• That is an option, i'm currently on excel attempting to figure out how to normalising this data and if it works. failing that i'll give the percentage idea a go :)
– Mike
Dec 6, 2011 at 16:08

In the end I decided to normalise the data by dividing each value by the maximum value and then multiplying by 100.

1. Find the maximum value:

  Date        Visits   Carts      carts       Orders
Created   converted    Created
2011-11-11    12277     161        9          36
2011-11-12    11871     93         5          19
2011-11-13    13072     107        8          8
2011-11-14    13594     112        4          34
2011-11-15    12741     129        8          43
2011-11-16    15491     261        16         57
2011-11-17    13418     186        17         42

maximum       15491     261        17         57

2. Divide each number by the maximum and then multiply by 100:

  Date        Visits   Carts      carts       Orders
Created   converted    Created
2011-11-11    79.25     61.68      52.94      63.15
2011-11-12    76.63     35.63      29.41      33.33
2011-11-13    84.38     40.99      47.05      14.03
2011-11-14    87.75     42.91      23.52      59.64
2011-11-15    82.24     49.42      47.05      75.43
2011-11-16    100       100        94.11      100
2011-11-17    86.61     71.26      100        73.68

3. I then plotted this on the graph, obviously this only demonstrates trend and the user has the table of data at the bottom of the page.

That would be my approach too - - to adjust the different dimensions to the same scale by dividing by X but I would use avg value, not max or min value. The reason is -- as you add data over time, your max or min will likely change, and then what was 100% in the last chart is something else this time - the chart isn't as easily reconcilable to prior charts - - if you use avg then the changes are not as drastic.