Econometrics

Performing inflation adjustment with price indices in economic analysis

Introduction

Generally, when I use cost data from the past, I tend to perform some kind of inflation adjustment. That’s because the value of $1 is not the same today as it was a year ago. Therefore, we need an approach to adjust the value of past costs into today’s terms. We think of past costs as nominal (or unadjusted) costs. To express these costs into today’s value, we need to perform an inflation adjustment.

Recently, I was working with my students, and they had pulled cost data from the Agency for Healthcare Research and Quality (AHRQ) Medical Expenditure Panel Survey (MEPS). MEPS provides healthcare expenditure data on a number of categories (e.g., total, outpatient, inpatient, and pharmacy). Once can download and use the MEPS data to study the trends in healthcare costs over time. However, the past healthcare costs are not adjusted for time and will require some application of a price index.

Depending on your needs, MEPS provides recommendations on what kind of price index to use. The most common price index is the Consumer Price Index (CPI). The United States (US) Bureau of Labor and Statistics (BLS) provides data on the CPI, which can be accessed on their website (link).  According to the BLS site, “The Consumer Price Index (CPI) is a measure of the average change over time in the prices paid by urban consumers for a market basket of consumer goods and services.”

The BLS also has a CPI calculator where you can enter the dollar amount at a specific month and year to estimate its inflation adjusted amount.

However, if you want to use the actual CPI data, you can download these from the BLS website (link).

 

Consumer Price Index Example

Here is a short tutorial on how to download the CPI data and perform an inflation adjustment.

Step 1. Download the CPI data from the BLS website.

Navigate to the BLS website (link). Click on “Tables.” This will bring you to the BLS CPI database page.

You see links to archived CPI releases. There is a lot of data on this site. To make things easier, we’ll focus on the annual CPI numbers.

Step 2. Select the Historical CPI-U, which contains all the annual CPI from its inception in the United States. This will be helpful in converting any dollar year into the inflation-adjusted dollar.

Note: We use the CPI-U because it includes all urban consumers, which represents over 90% of the total US population. There are other types of CPI calculations that you can use based on your needs. I encourage you to explore these.

Once you have downloaded the Historical CPI-U file. Open it and review the columns. The column that we are interested in is the “Annual” column, which contains the annual CPI for that year.  

Step 3: Let’s suppose that we were interested in performing an inflation adjustment for $100 in 2028 to 2025 value. We take the CPI for 2025, which is 321.943 and divide this by the CPI from 2008, which is 215.303.

Step 4: Once we have the inflation adjustment ratio, we can multiply this by $100 from 2008 to get the 2025 inflation-adjusted value.

Therefore, $100 in 2008 is worth $149.53 in 2025.

Personal Consumption Expenditures Example

But what if you wanted to use the Personal Consumption Expenditures (PCE) Price Index instead of CPI? MEPS recommends we use the PCE Price Index when we pool data from multiple years or evaluate trends across multiple years.

The PCE Price Index is available from the US Department of Commerce Bureau of Economic Analysis (BEA)website (link).

According to the Bureau of Economic Analysis, the PCE Price Index measures the “prices that people living in the United States, or those buying on their behalf, pay for goods and services.”

To get the PCE Price Index, you will need to do the following:

Step 1: Go to the BEA’s PCE Price Index website (link). Select Tools > Interactive Data. From there Select “Gross Domestic Product / Personal Income.” This will take you to another page where you can finally select “Interactive Data Tables.”

Step 2: In the interaction data tables page, Select “Section 2 – Personal Income and Outlays.” This will expand the field. Scroll down and Select “Table 2.5.4. Price Indexes for Personal Consumption Expenditures by Function (A).” The (A) indicates “Annual.” This opens the Interaction table where you can Modify the date range. By default, it will give you the most recent year and the last several years.

Step 3: Use the “Modify” option to change the time range.

Change the “First Year” to “2008 A,” This will expand the PCE Price Index time year from 2008 to 2024.

Notice that we don’t have 2025 on this Interactive table. The 2025 annual PCE Price Index is available, but you will have to do a little more digging.

Step 4: Go back to the National Income and Products Account and Select Table 2.8.4. Price Indexes for Personal Consumption Expenditures by Major Type of Product, Monthly (M).

Copy the PCE Price Index for the months of January all the way to December for 2025.

Paste this into Excel and average the PCE Price Index for all twelve months. This will give you the PCE Price Index for 2025.

Step 5: Now that we have the PCE Price Index for 2025, we can return to our previous example and perform an inflation adjustment of $100 from 2008 to its inflation-adjustment 2025 value.
We take the PCE Price Index for 2025, which is 126.919 and divide this by the PCE Price Index from 2008, which is 89.197.

Step 6: Once we have the inflation adjustment ratio, we can multiply this by $100 from 2008 to get the 2025 inflation-adjusted value.

Therefore, $100 in 2008 is worth $142.29 in 2025.

 

Conclusions

Adjusting past costs to current value is an important part of performing economic analyses, particularly when we are looking at the trends. If we don’t make this adjustment, our analysis will be incorrect and will generate the wrong conclusions. In this article, I reviewed two types of price indices, but there are others. MEPS provides a nice guideline on which ones to use on their website (link), and I encourage you to explore these.

 

Disclosures

This is a work in progress and subject to future changes.

This is for educational purposes only.

 

MEPS Tutorial 8: Estimating slopes from a regression model using R

In a previous tutorial, I reviewed how we can perform trend analysis using R on survey-weighted estimates. However, I neglected to discuss how to estimate the average slope across time. Rather, I focused on estimate the predicted values at each year.

In this tutorial, I show how you can use the margins command in R to estimate the survey-weighted average total healthcare expenditures across years for males and females. You can read the tutorial on my RPubs page (link).

Two-Part Model with Bootstrap using R

In this article, I wanted to expand on a previous post that describes using a two-part model to model cost (or total expenditure) as an outcome with data from the Agency for Healthcare Research and Quality (AHRQ) Medical Expenditure Panel Survey (MEPS). In the previous article, I used the twopartm package, which is great at leveraging the two-part model approach. However, it does not appear to handle data from complex survey designs like MEPS.

The best way to handle complex survey design data with weights using the two-part model approach is to perform the estimations for each part separately and then combine them.

With a little help from some AI chatbots, I was able to construct a viable code that not only estimates and combines both parts of the two-part model, but also allows me to bootstrap the results to generate 95% confidence intervals (CI).

The complete article on how to construct a two-part model with bootstrap using R is available on my RPubs site (link)

Propensity score matching in R

I wrote an introductory tutorial on how to perform propensity score matching using R, which has been posted on my RPubs site (link).

Propensity score matching is a statistical approach to balancing the observed covariates between groups. In observational studies, this method has the potential to mitigate potential confounding and allow us to make causal interpretations. However, there are a lot of approaches and nuances. This intorductory tutorial presents the basics of propensity score methods and how we can use these in our conventional analyses.

Stata - marginsplot & mplotoffset commands for plotting average marginal effects

In Stata, users have a lot of flexibility with creating plots, particularly after the margins command has been executed. Once a regression command has been run, users can estimate the average marginal effect of a factor with respect to another variable using the margins command in Stata. Once the average marginal effect has been estimated, users can plot this using the marginsplot or mplotoffset commands. These are power tools that allow us to visualize the average marginal effects, particularly when we have interaction terms.

I posted a tutorail on my RPubs site that revieweed some basic features of the marginsplot and mplotoffset commands and provide some practical examples of customization.

Prepost analysis with continuous data using R - Part 1

I wrote a tutorial on how to perform simple prepost analysis using R, which is available on my RPubs page. It covers how to compare two differences (change in value before and after an interention) using independent t test and linear regression approaches. However, it doesn’t cover how to address correlation between two dependent values. Part 2 of prepost analysis will cover those issues.

Some cool website on study design and biostatistics

This month (November 2024), I wanted to take a break from writing tutorial and articles. Instead, I wanted update myself on (and share) some very helpful/useful online resources.

A colleague of mine introduced me to website called Datamethods. It’s mainly a discussion forum, but it has some useful resources. This particular post contains references that are very useful for anyone who is interested in study design and biostatistics (link). It is a collection of papers and articles that addresses common myths and practices regarding the application of biostatistics in study designs.

Another great website is Scott Cunningham’s Mixed Taped Sessions. He has a book called Mixed Taped Session about causal inference, and he has regular workshops. I attended his Causal Inference Part 2 workshop, and it was amazing. We learned about the basic difference-in-differences methods (coding in R and Stata), and the innovations surrounding these methods (e.g., Callaway & Sant’Anna’s staggered difference-in-differences approach). Scott also provides the historical perspectives on these methods, which are insightful as they are entertaining. Moreover, he conducts interviews with prominant econometricians, which he posts on his YouTube channel.

Hopefully, these sites are useful for you as they have been for me.

Staggered difference-in-differences using R

I was interested in learning how to apply the Callaway & Sant'Anna staggered difference-in-differences framework to my work. After reading several papers and watching the video by Sant'Anna, I wrote a short tutorial on how to apply this framework to a simulated data. The tutorial is located on my RPubs site.

This is a unique method that used the R “did” package, which is based on the paper by Callaway & Sant’Anna.

Mediation analysis using R

It’s not uncommon to see covariates in a regression model that should not be there. For example, measurements that occur after the treatment assignment are included into a regression model as baseline covariates. Rather, one should consider a mediation analysis.

I wrote a tutorial on how to perform mediation analysis using R on my RPubs site (link).

I know that I make this mistake at times. This tutorial helped me to carefully consider which covariates to include in a regression model and which ones to consider for mediation analysis.

MEPS tutorial on interrupted time series analysis in R

I wrote a short tutorial on how to perform an interrupted time series analysis in R. I had a challenging time working on this because I wasn’t familiar with all the nuances of the ITSA. More importantly, I wasn’t able to leverage my Stata skills to do this in R. I’m used to the Stata margins command, which is great for creating constrasts. R has its own version of the margins command, but it lacks some of Stata’s features such as the pwcompare, which I use a lot in Stata. However, I found a workaround with linear splines, and I have uploaded this to my RPubs site (link). I hope you find this useful. I also saved my R Markdown code on my GitHub site (link).