Caclulating expenditures across event files

I would like to calculate total expenditures for a subset of patients across multiple event files (ie, inpatient, outpatient, and dental). How can I get a single estimate (mean + standard error)? I am using the package ‘survey’ in R, and can successfully generate estimates for my sub-population in each event file, but do not know how to generate a single estimate across all three files. Can I just combine them into one large file or will this mess with the weighting. I’m new to complex survey analysis, so appreciate your help.

Sorry, I left out that I am using the Medical Expenditure Panel Survey. Thought this was a forum just for MEPS.

Information about expenditure totals by provider type is available on the FYC files; OPEXPTOT (outpatient care), HPEXPTOT (inpatient care), and DVEXPTOT (dental care). If your goal is to summarize expenditures for each person and you do not require any other information from the event files, it would be much easier to use the FYC data available through IPUMS MEPS.

If, however, you are interested in other information from the event files, I would recommend referencing the sample code at the bottom of this page summarizing relationships between MEPS-HC files (sample code is for merging inpatient event and FYC data, then calculating average expenditures for the inpatient stay). Currently IPUMS MEPS only offers the Full-Year Consolidated (FYC) data from MEPS, though we are planning to add the event files in the future. If you are interested in merging event files from the Agency for Healthcare Research and Quality (AHRQ) onto your IPUMS MEPS FYC data extract, our user guide on how to combine IPUMS and AHRQ versions of MEPS data may be of interest to you.

Hi Grace, thank you so much for your reply, that was very helpful. The reason that I am hoping to estimate cost across the event files (and not the FYC) is that I only want to include certain events for each participant. For example, only events with a surgical procedure. It’s my understanding that if I use the FYC, I would not be able to parse out what component of inpatient or outpatient spending is attributed to, for example, surgery. Therefore, I would like to aggregate expenditure only for surgical events within the inpatient, outpatient, and dental files. Do you know how I might do that? Thank you!

I see, thank you for providing more in-depth context about your analysis. I agree that you will need to utilize the event files in order to aggregate expenditure for specific events (such as surgery) per patient. Merging event files with FYC files is recommended, as noted in the sample code I shared previously (provided by MEPS), in order to preserve survey variables for all persons in the data. In addition, by merging all event files with FYC files, you can calculate expenditure due to surgery per person and then estimate statistics using PERWEIGHT.