Loading MEPS data
Stata svy
commands
Stata exercises
In Stata, transport (.ssp) files can be loaded using the import
function. In the following example, the transport file h171.ssp has been downloaded from the MEPS website, unzipped, and saved in the local directory C:\MEPS\data (click here for details)
set more off
import sasxport "C:\MEPS\data\h171.ssp"
To save the loaded data as a permanent Stata dataset (.dta), run the following code (first create the 'Stata\data' folders if needed):
save "C:\MEPS\Stata\data\h171.dta"
clear
To analyze MEPS data using Stata, svy
commands should be used to ensure unbiased estimates. As an example, the following code will estimate the total healthcare expenditures in 2014:
use dupersid perwt14f varpsu varstr totexp14 using "C:\MEPS\Stata\data\h171.dta", clear
svyset varpsu [pweight=perwt14f], str(varstr)
svy: total totexp14
Several exercises are provided as examples of calculating estimates using MEPS data:
Exercise 1: National health care expenses by type of service
Exercise 2: Expenditures and utilization of antipsychotics (from statistical brief #275)
Exercise 3: Constructing family-level estimates
Exercise 4: Use and expenditures for persons with diabetes
Exercise 5: Expenditures for all events associated with diabetes
Exercise 6: Pooling multiple years of MEPS data
Exercise 7: Constructing insurance status variables from monthly insurance variables
Exercise 8: Pooling longitudinal files
Each folder contains two files:
- Stata 'do' file (.do)
- Stata log file (.log)