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)