Skip to Main Content
It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.
These pesky variables are red in the Data Editor window. Because they are text rather than numeric, they don't play well with most statistical tests.
encode varname, generate(newvar) will convert a categorical string variable into a numeric one with labels.
destring varlist, generate(newvarlist) is what you want when your string really is a number (often happens when you import data with dollar signs or NA values).
Adjusting for Inflation
Install using "ssc install cpigen." Adds a consumer price index variable to your dataset.
Consumer Price Indexes (FRED)
If cpigen doesn't have the years or series that you want, you can also get CPI data from FRED. Either download from the FRED site or go to File > Import > Federal Reserve Economic Data, and search for CPIAUCSL.