Skip to content
This repository provides example code for loading and analyzing data from AHRQ's Medical Expenditure Panel Survey (MEPS). More information about the survey and access to public use data files is available on our website
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
Quick_Reference_Guides Adding missing * to event file names Jul 15, 2019
R Renaming to "exercise" for consistency Sep 13, 2018
SAS Updating after format change Jan 3, 2019
Stata Fixing broken links Sep 13, 2018
_images Adding MEPS entity relationship diagram Mar 11, 2019 Updating README Jan 2, 2019

Medical Expenditure Panel Survey (MEPS)

This repository contains instructions and example code for loading and analyzing data from the Agency for Healthcare Research and Quality's Medical Expenditure Panel Survey (MEPS) Household Component (HC), as well as presentation slides from the most recent MEPS Workshop. Quick reference guides are also provided for convenience.

MEPS Workshops
Survey Background
Accessing MEPS-HC data
Analyzing MEPS-HC data
Additional Survey Components
Contact MEPS

Example code for loading and analyzing MEPS data in R, SAS, and Stata is available in the following folders. These folders also include example exercises from recent MEPS workshops. In addition, the SAS folder contains exercises from older workshops (1996-2006):

MEPS Workshops

The Agency for Healthcare Research and Quality (AHRQ) conducts several workshops throughout the year. These workshops provide extended knowledge about MEPS data, practical information about usage of MEPS public use data files and an opportunity to construct analytic files with the assistance of AHRQ staff. The workshops are designed for health services researchers who have a background or interest in using national health surveys. For questions regarding MEPS Workshops, please contact Anita Soni at Information on upcoming workshops is posted on the MEPS website. Check back regularly for updates.

The agenda, presentation slides, and programming exercises for the most recent workshop are available in the MEPS-workshop repository.

Survey Background

The Medical Expenditure Panel Survey, which began in 1996, is a set of large-scale surveys of families and individuals, their medical providers (doctors, hospitals, pharmacies, etc.), and employers across the United States. The MEPS Household Component (MEPS-HC) survey collects information from families and individuals pertaining to medical expenditures, conditions, and events; demographics (e.g., age, ethnicity, and income); health insurance coverage; access to care; health status; and jobs held. Each surveyed household is interviewed five times (rounds) over a two-year period:

MEPS over-lapping panel design

The MEPS-HC is designed to produce national and regional estimates of the health care use, expenditures, sources of payment, and insurance coverage of the U.S. civilian noninstitutionalized population. The sample design of the survey includes weighting, stratification, clustering, multiple stages of selection, and disproportionate sampling.

Accessing MEPS-HC data

Data from the Household Component of MEPS are available for download as public use files. Each dataset contains .zip and .exe files in ASCII and SAS transport format.

MEPS data files website screenshot

To download the data, unzip and save the ASCII (.dat) or SAS transport (.ssp) file to your local computer. For example, the 2014 full-year-consolidated files h171.dat and h171.ssp can be stored in a local directory 'C:\MEPS\data':

Windows folder containing h171.dat and h171.ssp

The steps for loading the .dat or .ssp files depends on the programming language being used. Code for loading .ssp files in R, SAS, and Stata are available in the corresponding folders.

When reading MEPS data directly from the MEPS website, it is often helpful to know the complete name of the zip file. To find the name of the zip file, navigate to the dataset on the MEPS website, right-click on the ZIP link, then select 'Copy link address' to copy the location to the clipboard.

'Copy link address' selection on MEPS data file website

This link can then be used to programmatically import MEPS data directly into programming code. Details on this method are provided in the R, SAS, and Stata folders.

Shortened file names by data type and year can be found at the quick reference guide meps_file_names.csv.

Analyzing MEPS-HC data

The complex survey design of MEPS requires special methods for analyzing MEPS data. These tools are available in many common programming languages including R, SAS, and Stata. Failure to account for the survey design can result in biased estimates. Details and examples of using the appropriate survey methods are provided for R, SAS, and Stata. Additional examples comparing these three languages can be found in the quick reference guide

Note to User: All code provided in this repository is intended as an example for loading and analyzing MEPS data. AHRQ cannot certify the quality of your analysis. It is the user's responsibility to verify the accuracy of the results.

Additional Survey Components

In addition to the Household Component (MEPS-HC), MEPS is comprised of two additional components: The MEPS Medical Provider Component (MEPS-MPC) and the MEPS Insurance Component (MEPS-IC). The MEPS-MPC survey collects information from providers of medical care that supplements the information collected from persons in the MEPS-HC sample in order to provide the most accurate cost data possible. The MEPS-IC survey collects information from employers in the private sector and state and local governments on the health insurance coverage offered to their employees. It also includes information on the number and types of private health insurance plans offered, benefits associated with these plans, annual premiums and contributions to premiums by employers and employees, copayments and coinsurance, by various employer characteristics (for example, State, industry and firm size).

Special permissions are required to access datasets from the MPC and IC components. Access to the MEPS-MPC data can be requested from the AHRQ data center. For access to the MEPS-IC data, visit the Census Bureau's data center website.

Contact MEPS

Please review the Frequently Asked Questions on our website before contacting us to see if we already have an answer to your question. Also read our Privacy Policy for answers to any questions you may have about the use of your e-mail address.

You can contact us by e-mail, mail, or telephone:

MEPS Project Director
Medical Expenditure Panel Survey
Agency for Healthcare Research and Quality
5600 Fishers Lane
Rockville, MD 20857
(301) 427-1406

You can’t perform that action at this time.