Skip to content

Latest commit

 

History

History
 
 

SAS

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Analyzing MEPS data using SAS

Loading MEPS data
SAS SURVEY procedures
SAS exercises

Loading MEPS data

In SAS 9.4, transport (.ssp) files can be read in using PROC XCOPY. In the following example, the SAS 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)

FILENAME in_h171 'C:\MEPS\data\h171.ssp';

proc xcopy in = in_h171 out = WORK IMPORT;
run;

To save the loaded data as a permanent SAS dataset (.sas7bdat), run the following code (first create the 'SAS\data' folders if needed):

LIBNAME sasdata 'C:\MEPS\SAS\data';

data sasdata.h171;
  set WORK.h171;
run;

SAS SURVEY procedures

To analyze MEPS data using SAS, SURVEY procedures should be used (e.g. SURVEYMEANS, SURVEYREG) to ensure unbiased estimates. As an example, the following code will estimate the total healthcare expenditures in 2014:

proc surveymeans data = h171 sum;
  stratum VARSTR;
  cluster VARPSU;
  weight PERWT14F;
  var TOTEXP14;
run;

SAS exercises

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 three files:

  1. SAS program file (.sas)
  2. SAS log file (.LOG)
  3. SAS list file containing output (.LST)