tutorials

Two-part models in R - Application with cost data

I created a tutorial on how to use two-part models in R for cost data. I used the healthcare expenditures from the Medical Expenditure Panel Survey in 2017 as a motivating example. Normally, I use Stata when I construct two-part models. But I wanted to learn how I could do this in R. Fortunately, R has a package called twopartm that was developed by Duan and colleagues. You can find their document for the twopartm package here.

The tutorial I created is located on my GitHub page and RPubs page.

MEPS Tutorial - Part 1: Loading Data into R

For the last couple of years, I have used Stata whenever I worked with MEPS data. Stata is a great statistical program that allows me to script and analyze data from complex survey designs similar to MEPS. However, R is another powerful statistical program that researchers have been using to evaluate and analyze MEPS data. R is free/open source and has a large community that constantly builds packages to improve its utility. Because of its advantages, I wanted to start writing tutorials on how to use R to analyze MEPS data.

This first tutorial provides instructions on how to load MEPS data into R, which is a critical step for data analysis.

You can find the tutorial on my RPubs page (link); I also posted this on my GitHub page (link).

For those of you who are interested in how I developed this tutorial, the R Markdown code is located on my GitHub page (link).

In the coming months, I’ll continue to write more tutorials using R with MEPS data, so stay tuned.