## Wednesday, April 10, 2013

### Logging

I know two ways to make a "log" graph at FRED. You can "Apply a Transformation to the Formula Result", selecting the "Natural Log" option. Or you can modify the graph settings, and check a checkbox to make the vertical scale a log scale.

The first method changes the values of your data, and gives you regularly spaced numbers on the vertical scale.

The second method does not change the values of your data, but gives you irregularly spaced numbers on the vertical scale.

Each of the graphs below shows one data series two ways. The blue line uses the first method, where taking the natural log changes the values. The red line uses the second method, which keeps the original values but adjusts the vertical scale.

The blue line in each of the following examples is plotted on the left-hand scale, and the red line on the right scale:

 Graph #1

 Graph #2

 Graph #3

Why, you may ask, do the graphs show different mismatches? For population the lines run parallel. For GDP, they cross in the middle. And for debt, they meet at the end.

Really, this is a matter of stretching or sliding one line a little more or less than the other. It has to do, I think, with the automated selection of "round numbers" for the vertical scale values. But despite these slight mismatches, you can see that the two methods of creating a log graph produce lines of similar shape.

#### 1 comment:

Jerry said...

A man goes to the park one summer with his family. He sees a bunch of snakes, but notices that they are all adults -- no baby snakes.

So he asks one of the snakes, "Where are all of the baby snakes?"