My software packages in Stata or otherwise.
Inflate is a Stata program that inflates variables to real dollars using the U.S. Consumer Price Index (CPI). Useful for putting time series that vary across years, quarters, or months in real dollars, so you do not have to deal with merging in the CPI series yourself!
Inflate is available on SSC. In Stata install by running:
ssc install inflate
The following code takes two monthly time series and puts them in real 2020 $.
Load in the nominal M1 and M2 money stocks from FRED.
freduse M1SL M2SL
Make year and month variables.
gen year = year(daten)
gen month = month(daten)
Inflate both series to 2020 $.
inflate M1SL M2SL, year(year) month(month) end(2020)
Now there are two new variables named M1SL_real and M2SL_real.