dinsdag 7 juli 2015

Using -reindex- to calculate real trends

We live in a real world, not in a nominal fiction. Hence it is practical and sensible to express amounts of money in real terms. I will show how to use my Stata user command - reindex -  to help you with this.

There is no straightforward way of deflating. When the monetary base expands, inflation may result. But it is also possible that economic activity increases, in which case you can still buy one can of coke with one euro, but as you happen to have two euros, you can buy two.

There are four standard ways of deflating prices:

  1. The GDP deflator is the ratio between the nominal gdp and the 'real' gdp which is the counterfactual with prices of the reference year. Even if it seems a logical way of calculating price increases, there are numerous biases in this measure - I can't find out what to do with new goods that weren't priced the year before. The standard GDP deflator is measured based on goods produced in the economy. 
  2. The deflator of consumed goods is exactly the same but with the current goods that are purchased. Importantly, the basket of goods changes every year.
  3. The (national) consumer price index is a fixed basket of goods corresponding to the average household's consumption, of which prices are tracked over time. Only in the longer term the basket is changed, often when goods have become out of fashion for a while already. Sometimes there are minor adjustments to the weights of goods.
  4. The harmonised consumer price index is the same as above but with an internationally harmonised basket of goods. Of all deflators I find this one capturing inflation best.
Data may be monthly, quarterly, come as an index or as a yearly change. Before continuing, make sure you transform into the time period of the nominal variable you want to convert. Indicate the unit within i() and the year variable in j(). Merge the data based on year and units.

Now use -reindex- to set both the deflator and the nominal variable to the same type. Reindex can work with four types:
  • Levels
  • Index
  • Percentages
  • Factors
Note that levels can only be converted into the trend types, not the other way around. Note also that percentages and factors are actually the same thing, but the percentage change is the factor change minus one.

For percentage trends, we commonly find an expression like the following:

%.real growth = %.nominal growth - %.inflation

This is a rule of thumb that is ok for small numbers. However, the right calculation is in factors:

nominal growth / real growth = inflation,

which in logs would be ln.nominal - ln.real = ln.inflation and as the log of a factor between .90 and 1.10 is very close to the percentual change (i.e. factor - 1), the 'easy' formula above would hold.

We can move factors to obtain:

real = nominal / inflation

The above we can also use with indices, where you set the base for all indices in one and the same year marked by tobase() to 100 using toscale(), except for the deflator (inflation) which you set to 1. The reindex program allows setting the base time and scale.