How do you calculate inflation rate using CPI? an Example in Stata

In this hands-on tutorial in Stata, I teach you how to calculate the 12-month inflation rate change and the 1-month inflation rate change using the Consumer Price Index (CPI) for the USA. I also teach you how to plot the two series together and make it look professional. In the tutorial, I cover the commands to generate lagged variables, to produce inflation rate changes, and also to round numbers. Normally, Stata produces too many decimals. Using the “round” function, you can decide how many decimals to include in the series. For this real hands-on example, we replicate the results provided by the “US Inflation Calculator” website, which comes in handy to see the data clean and in an easy-to-navigate website.

The US CPI is published by the US Bureau of Labor Statistics . By the end of the tutorial, you will be able to produce a graph like the one below. Also, you can download for free the complete Stata DO file, dataset and slides used in the tutorial (link at the end of the article).

What is the difference between the 1 month and 12 month inflation rate change?

The 1-month inflation rate change and 12-month inflation rate change are two different measures used to track inflationary trends over different time periods. The 1-month rate change compares the current Consumer Price Index (CPI) to the CPI from the previous month, providing a snapshot of inflationary pressures over a short-term period. This allows policymakers and market participants to assess recent changes in prices and make immediate adjustments to economic policies or strategies. In contrast, the 12-month rate change compares the current CPI to the CPI from the same month one year ago, offering a longer-term perspective on inflation trends. This measure smooths out short-term fluctuations and provides insights into broader inflationary patterns and trends over time. Countries may choose to emphasize one measure over the other based on factors such as the urgency of addressing immediate inflationary pressures, data availability, and policy objectives. For instance, countries with high inflation rates, like Argentina, may prioritize publishing the 1-month inflation rate change to enable swift responses to rapid price fluctuations, while others may focus on the 12-month rate change to gauge long-term inflation trends and formulate more strategic policy responses.