How to display magnitude of change over time between two series?

Disclaimer: I know absolutely nothing about statistics. I've had trouble searching for answers to my question, as I don't have much knowledge about the terminology of statistics.

I'm currently trying to plot a graph with two sets of values that are widely different. This doesn't really matter, but I'm doing this in Python with the matplotlib library.

One of my sets of values is a company's stock price over several days. My second set of data has much, much smaller values, but I'd like to be able to compare both lines side by side. I'm more interested in the magnitude of the changes than in the actual values.

For the moment, the only idea I've had is the following:

• Average the first values.

• Average the second values.

• Divide the first average by the second one, as to find a coefficient.

• Divide every single value in the first set of data by this coefficient.

Now, this looks fine, but I don't know anything about statistics, so is this correct? If it isn't, what's a better way to do it?

-
A first start would be to normalize each series by subtracting the mean from each data point and then dividing each point of the resulting series by the standard deviation. Do this separately for each series and then plot them together. –  cardinal Jan 13 '12 at 1:30
add comment

2 Answers

If you are interested in the changes as a fraction, then simply plot the logarithm of the values. A fixed distance in log space is a fixed fractional change, so if one line is steeper than the other it is changing more rapidly.

The log scale may also allow you to conveniently get both sets of values onto one graph without having to normalize the values in any way.

-
add comment

You ask "is this correct?" and "is there a better way to do it?" but the answers to these questions depend on what exactly you are trying to do. A statistical graph is "wrong" only if it does things like distort the data; it is "bad" if it is hard to read, etc.

Are you interested in the difference between the two stock prices? Then subtract one from the other and plot that. Are you interested in the ratio? Then divide the larger by the smaller and plot that. (Cleveland showed that it is easier to interpret a single line than the relationship between two lines; his example was imports and exports from some country (England, IIRC) over time).

Do you need both series? Well, you could standardize (see earlier answers) or you could just multiply one series by some convenient number (be sure to state this!) - the latter may be easier for your audience to grasp.

I highly recommend William Cleveland's books.

-
add comment