DOI: 10.7910/dvn/b3d7w1
title: Medical Expenditure Panel Survey (MEPS)

description: &lt;h3 class="post-title entry-title" itemprop="name"&gt; analyze the medical expenditure panel survey (meps) with r &lt;/h3&gt; the meps household component leads the pack for examining individual-level medical expenditures by payor and type of service. total expenditures captured by the survey tend to be &lt;a href="http://www4a.cms.gov/Research-Statistics-Data-and-Systems/Research/HealthCareFinancingReview/downloads/06Fallpg25.pdf"&gt;low, but unbiased across the board&lt;/a&gt; and &lt;a href="http://links.govdeliver
y.com/track?type=click&amp;enid=ZWFzPTEmbWFpbGluZ2lkPTIwMTMwMTAyLjEzOTEyNTcxJm1lc3NhZ2VpZD1NREItUFJELUJVTC0yMDEzMDEwMi4xMzkxMjU3MSZkYXRhYmFzZWlkPTEwMDEmc2VyaWFsPTE3MDA5OTQyJmVtYWlsaWQ9cmdhcmZpZWxkQGtmZi5vcmcmdXNlcmlkPXJnYXJmaWVsZEBrZmYub3JnJmZsPSZleHRyYT1NdWx0aXZhcmlhdGVJZD0mJiY=&amp;&amp;&amp;100&amp;&amp;&amp;http://www.cms.gov/Research-Statistics-Data-and-Systems/Research/MMRR/Downloads/MMRR2012_002_04_a09.pdf"&gt;can be adjusted to match the national health expenditure accounts&lt;/a&gt;. i wrote &lt;a
href="http://en.wikipedia.org/wiki/Medical_Expenditure_Panel_Survey"&gt;the wikipedia article
&lt;/a&gt;, so it's data-oriented. if you vandalize it, i will revert your changes and t.p. your front yard. give it a read for more details about what's possible. &lt;a href="http://www.ahrq.gov/"&gt;the agency for healthcare research and quality (ahrq)&lt;/a&gt; produces meps and rhymes with shark.&lt;br /&gt; &lt;br /&gt; the medical expenditure panel survey - household component (meps-hc) contains data laid out a few different ways. &lt;a href="http://meps.ahrq.gov/mepsweb/data_stats/download_data_files_codebook.jsp?PUF
Id=H129&amp;sortBy=Start"&gt;the consolidated file&lt;/a&gt; has one-record-per-person with all the complex sample survey variables. start there. the &lt;a href="http://en.wikipedia.org/wiki/Medical_Expenditure_Panel_Survey#Household_Component_Event_Files"&gt;eight event files&lt;/a&gt; contain one-record-per-person-per-event, and (except for &lt;a href="http://meps.ahrq.gov/mepsweb/data_stats/download_data_files_results.jsp?cboDataYear=All&amp;cboDataTypeY=2%2CHousehold+Event+File&amp;buttonYearandDataType=Search&am
p;cboPufNumber=All&amp;SearchTitle=Other+Medical+Expenses"&gt;the supplies/vision table&lt;/a&gt;) those events have some sort of dates. crikey. there are tables with one-record-per-person-per-medical-condition, one-record-per-job, even a one-record-per-person-per-interview-per-private-health-plan table for anyone who wants to spend less time with his or her family. if you &lt;a href="http://www.screenr.com/Znd8"&gt;merge&lt;/a&gt; anything to the consolidated file, make sure you understand the difference between
setting the parameter all.x = TRUE versus all.x = FALSE -- some respondents have zero records in the non-consolidated files, others have multiple. hot tip: you probably want to aggregate non-consolidated files somehow. you might use
&lt;a href="http://www.screenr.com/JQS8"&gt;tapply and aggregate&lt;/a&gt;, but i prefer &lt;a href="http://www.screenr.com/zmd8"&gt;aggregation using sql&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; everything can be read in as a sas transport file (.ssp) using &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/foreign/html/read.xport.html"&gt;read.xport&lt;/a&gt;, but if you like making things harder than they have to be (i.e. &lt;a href="http://en.wikipedia.org/wiki/Fixed-gear_bicycle"&gt;if you ride a fixie&lt;/a&gt;), you can also follow the example bu
ried in &lt;a href="https://github.com/ajdamico/SAScii/blob/abf6a69761239412b40a1967bc448821d7120ef5/man/read.SAScii.Rd#L128"&gt;the ?read.SAScii documentation&lt;/a&gt;. ahrq draws the meps sample from &lt;a href="http://meps.ahrq.gov/mepsweb/data_stats/download_data_files_detail.jsp?cboPufNumber=LINK_96-10MEPS/NHIS"&gt;the national health interview survey&lt;/a&gt;, interviews about thirty-five thousand individuals per year, and keeps everyone &lt;a href="http://meps.ahrq.gov/mepsweb/data_stats/download_data_files_res
ults.jsp?cboDataYear=All&amp;cboDataTypeY=1%2CHousehold+Full+Year+File&amp;buttonYearandDataType=Search&amp;cboPufNumber=All&amp;SearchTitle=Longitudinal"&gt;in the panel for two years&lt;/a&gt;. half of the respondents are in their first of two years of interviews, half are in their second. capice? meps generalizes to the us non-institutional, non-active duty military population. this new github repository contains three scripts:&lt;br /&gt; &lt;br /&gt; &lt;b&gt;1996-2010 household component - download all microdata
.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;loop through every year and every file type, download, then rename according to a pattern&lt;/li&gt; &lt;li&gt;save each file as an &lt;a href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/save.html"&gt;r data file&lt;/a&gt; (.rda) and (if specified by the user) sas transport (.ssp), &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/utils/html/write.table.html"&gt;comma-separated value&lt;/a&gt; (.csv), and &lt;a href="http://stat.ethz.ch/R-manual/R-devel/library/foreign/html/write.dta.html"&gt;s
tata-readable&lt;/a&gt; (.dta)&lt;/li&gt; &lt;li&gt;download the codebook and documentation, if available&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2010 consolidated - analyze with brr.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load the r data file (.rda) created by the download script (above)&lt;/li&gt; &lt;li&gt;set up the balanced repeated replication design outlined in &lt;a href="http://meps.ahrq.gov/mepsweb/data_stats/download_data/pufs/h36brr/h36b09doc.shtml"&gt;this document&lt;/a&gt;&lt;/li&gt; &lt;li&gt;perform a boatload of analysis examples (spoiler: there will be &lt;a href="http:
//stat.ethz.ch/R-manual/R-patched/library/graphics/html/barplot.html"&gt;barplots
&lt;/a&gt;)&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;b&gt;2010 consolidated - analyze with tsl.R&lt;/b&gt;&lt;br /&gt; &lt;ul&gt; &lt;li&gt;load the r data file (.rda) created by the download script (above)&lt;/li&gt; &lt;li&gt;set up a taylor-series linearization survey design outlined in &lt;a href="http://meps.ahrq.gov/mepsweb/survey_comp/standard_errors.jsp"&gt;this document&lt;/a&gt;&lt;/li&gt; &lt;li&gt;perform the same boatload of analysis examples&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; &lt;br /&gt; &lt;a href="https://github.com/ajdamico/usgsd/tree/master/Medical%20Expenditure%20Panel%20Survey"&gt;click here
to view these three scripts&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; for more detail about the medical expenditure panel survey - household component (meps-hc), visit:&lt;br /&gt; &lt;ul&gt; &lt;li&gt;the agency for healthcare research and quality's &lt;a href="http://meps.ahrq.gov/"&gt;medical expenditure panel survey homepage&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://meps.ahrq.gov/mepsweb/survey_comp/Insurance.jsp"&gt;the meps insurance component homepage&lt;/a&gt; (microdata not publicly available)&lt;/li&gt; &lt;li&gt;a younger version of myself giving &lt;a href="htt
p://www.kaiseredu.org/tutorials/onlinedata/player.html"&gt;an introduction to online query tools
&lt;/a&gt; with &lt;a href="http://meps.ahrq.gov/data_stats/meps_query.jsp"&gt;mepsnet&lt;/a&gt; at slide ten&lt;/li&gt; &lt;/ul&gt; &lt;br /&gt; notes:&lt;br /&gt; &lt;br /&gt; if you don't know which analysis method to use, choose the replicate weights. replicate weighting requires slightly more ram, but taylor-series designs don't allow the computation of a confidence interval around quantile statistics (like the median).&lt;br /&gt; &lt;br /&gt; this repository doesn't include a script to replicate the meps taylor-series linearization or replicate-w
eighted methods of variance calculation, because i wrote &lt;a href="http://journal.r-project.org/archive/2009-2/RJournal_2009-2_Damico.pdf"&gt;the original journal article&lt;/a&gt; with meps. it's legit.&lt;br /&gt; &lt;br /&gt; if you just want a one-off statistic and can't bear to get your typing fingers dirty, try &lt;a href="http://meps.ahrq.gov/data_stats/meps_query.jsp"&gt;their fabulous table-building website mepsnet&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; confidential to sas, spss, stata, sudaan users: why are you still making ca
lls with two tin-cans and a string now that we've created cell phones? time to transition to r. :D