/************************************************************************************************/ /* Stata User File for H140 Data */ /* */ /* This file contains information and a sample Stata program to create a permanent */ /* Stata dataset for users who want to use Stata in processing the MEPS data provided */ /* in this PUF release. Stata (StataCorp) has the capability to produce */ /* appropriate standard errors for estimates from a survey with a complex sample */ /* design such as the Medical Expenditure Panel Survey (MEPS). */ /* The input file for creating a permanent Stata dataset is the ASCII data file */ /* (H140.DAT) supplied in this PUF release, which in turn can be extracted from the */ /* .EXE file. After entering the Stata interactive environment access the Stata DO-File */ /* editor by clicking on the appropriate icon in the command line at the top of the */ /* screen. Copy and paste the following Stata commands into the editor and save as a */ /* DO file. A DO file is a Stata program which may then be executed using the DO command. */ /* For example, if the DO file is named H140.DO and is located in the directory */ /* C:\MEPS\PROG, then the file may be executed by typing the following command into */ /* the Stata command line: */ /* do C:\MEPS\PROG\H140.DO */ /* The program below will output the Stata dataset H140.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; set memory 40m; log using H140.log, replace; clear; * INPUT ALL VARIABLES; infix str DUPERSID 1-8 byte PANEL 9-10 byte YEARONE 11-11 byte INSCAT1 12-13 byte AGESEXPV 14-15 byte AGESEXMC 16-17 byte AGESEXMD 18-19 double RRSHCCPV 20-28 double RRSASPV 29-37 double RRSHCCMC 38-46 double RRSASMC 47-55 double RRSHCCMD 56-64 double RRSASMD 65-73 double RRSHCCUN 74-82 double RRSASUN 83-91 double HCCPV 92-100 double ASPV 101-109 double HCCMC 110-118 double ASMC 119-127 double HCCMD 128-136 double ASMD 137-145 double LONGWT 146-158 using H140.dat; *DEFINE VARIABLE LABELS; label variable DUPERSID "PERSON ID (DUID + PID)"; label variable PANEL "PANEL FLAG"; label variable YEARONE "INDICATOR IF RECORD HAS YEAR ONE DATA"; label variable INSCAT1 "YR 1: TYPE OF INSURANCE COVERAGE"; label variable AGESEXPV "DXCG AGESEX COMBINED GROUP, PRIVATE"; label variable AGESEXMC "DXCG AGESEX COMBINED GROUP, MCARE"; label variable AGESEXMD "DXCG AGESEX COMBINED GROUP, MCAID, 0-64"; label variable RRSHCCPV "RELATIVE RISK SCORES, HCC, PRIVATE"; label variable RRSASPV "RELATIVE RISK SCORES, AGESEX, PRIVATE"; label variable RRSHCCMC "RELATIVE RISK SCORES, HCC, MCARE"; label variable RRSASMC "RELATIVE RISK SCORES, AGESEX, MCARE"; label variable RRSHCCMD "RELATIVE RISK SCORES, HCC, MCAID, 0-64"; label variable RRSASMD "RELATIVE RISK SCORES, AGESEX, MCAID,0-64"; label variable RRSHCCUN "RELATIVE RISK SCORES,HCC,PRIV,NORM UNINS"; label variable RRSASUN "RELT RISK SCORES, AGESEX,PRIV,NORM UNINS"; label variable HCCPV "NOT NRMLZD RISK SCORES, HCC, PRIV&UNINS"; label variable ASPV "NOT NRMLZD RISK SCORES,AGESEX,PRIV&UNINS"; label variable HCCMC "NOT NRMLZD RISK SCORES, HCC, MCARE"; label variable ASMC "NOT NRMLZD RISK SCORES, AGESEX, MCARE"; label variable HCCMD "NOT NRMLZD RISK SCORES, HCC, MCAID, 0-64"; label variable ASMD "NOT NRMLZD RISK SCORES,AGESEX,MCAID,0-64"; label variable LONGWT "LONGITUDINAL WEIGHT"; *DEFINE VALUE LABELS FOR REPORTS; label define H1400001X -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" 1 "1 FEMALE AGE 0-1" 10 "10 FEMALE AGE 60-64" 11 "11 FEMALE AGE 65-69" 12 "12 FEMALE AGE 70-74" 13 "13 FEMALE AGE 75-79" 14 "14 FEMALE AGE 80-84" 15 "15 FEMALE AGE 85+" 18 "18 MALE AGE 0-1" 19 "19 MALE AGE 2-5" 2 "2 FEMALE AGE 2-5" 20 "20 MALE AGE 6-12" 21 "21 MALE AGE 13-17" 22 "22 MALE AGE 18-24" 23 "23 MALE AGE 25-34" 24 "24 MALE AGE 35-44" 25 "25 MALE AGE 45-54" 26 "26 MALE AGE 55-59" 27 "27 MALE AGE 60-64" 28 "28 MALE AGE 65-69" 29 "29 MALE AGE 70-74" 3 "3 FEMALE AGE 6-12" 30 "30 MALE AGE 75-79" 31 "31 MALE AGE 80-84" 32 "32 MALE AGE 85+" 4 "4 FEMALE AGE 13-17" 5 "5 FEMALE AGE 18-24" 6 "6 FEMALE AGE 25-34" 7 "7 FEMALE AGE 35-44" 8 "8 FEMALE AGE 45-54" 9 "9 FEMALE AGE 55-59" ; label define H1400002X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" 1 "1 FEMALE AGE 0-5" 17 "17 MALE AGE 0-5" 18 "18 MALE AGE 6-12" 19 "19 MALE AGE 13-17" 2 "2 FEMALE AGE 6-12" 20 "20 MALE AGE 18-24" 21 "21 MALE AGE 25-34" 22 "22 MALE AGE 35-44" 23 "23 MALE AGE 45-54" 24 "24 MALE AGE 55-59" 25 "25 MALE AGE 60-64" 3 "3 FEMALE AGE 13-17" 4 "4 FEMALE AGE 18-24" 5 "5 FEMALE AGE 25-34" 6 "6 FEMALE AGE 35-44" 7 "7 FEMALE AGE 45-54" 8 "8 FEMALE AGE 55-59" 9 "9 FEMALE AGE 60-64" ; label define H1400003X -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" 1 "1 FEMALE AGE 0-1" 10 "10 FEMALE AGE 60-64" 11 "11 FEMALE AGE 65-69" 12 "12 FEMALE AGE 70-74" 13 "13 FEMALE AGE 75-79" 14 "14 FEMALE AGE 80-84" 15 "15 FEMALE AGE 85+" 18 "18 MALE AGE 0-1" 19 "19 MALE AGE 2-5" 2 "2 FEMALE AGE 2-5" 20 "20 MALE AGE 6-12" 21 "21 MALE AGE 13-17" 22 "22 MALE AGE 18-24" 23 "23 MALE AGE 25-34" 24 "24 MALE AGE 35-44" 25 "25 MALE AGE 45-54" 26 "26 MALE AGE 55-59" 27 "27 MALE AGE 60-64" 28 "28 MALE AGE 65-69" 29 "29 MALE AGE 70-74" 3 "3 FEMALE AGE 6-12" 30 "30 MALE AGE 75-79" 31 "31 MALE AGE 80-84" 32 "32 MALE AGE 85+" 4 "4 FEMALE AGE 13-17" 5 "5 FEMALE AGE 18-24" 6 "6 FEMALE AGE 25-34" 7 "7 FEMALE AGE 35-44" 8 "8 FEMALE AGE 45-54" 9 "9 FEMALE AGE 55-59" ; label define H1400004X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400005X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400006X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400007X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400008X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400009X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400010X -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" 1 "1 MEDICARE" 2 "2 PRIVATE" 3 "3 MEDICAID" 4 "4 UNINSURED" ; label define H1400011X 10 "PANEL 10 (2005-2006)" 11 "PANEL 11 (2006-2007)" 12 "PANEL 12 (2007-2008)" 13 "PANEL 13 (2008-2009)" 14 "PANEL 14 (2009-2010)" 7 "PANEL 7 (2002-2003)" 8 "PANEL 8 (2003-2004)" 9 "PANEL 9 (2004-2005)" ; label define H1400012X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400013X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400014X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400015X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400016X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400017X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400018X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400019X -1 "-1 PERSONS AGE 65+" -9 "-9 RECORD DOES NOT HAVE YEAR ONE DATA" ; label define H1400020X 1 "1 RECORD HAS YEAR ONE DATA" 2 "2 RECORD DOES NOT HAVE YEAR ONE DATA" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value AGESEXMC H1400001X; label value AGESEXMD H1400002X; label value AGESEXPV H1400003X; label value ASMC H1400004X; label value ASMD H1400005X; label value ASPV H1400006X; label value HCCMC H1400007X; label value HCCMD H1400008X; label value HCCPV H1400009X; label value INSCAT1 H1400010X; label value PANEL H1400011X; label value RRSASMC H1400012X; label value RRSASMD H1400013X; label value RRSASPV H1400014X; label value RRSASUN H1400015X; label value RRSHCCMC H1400016X; label value RRSHCCMD H1400017X; label value RRSHCCPV H1400018X; label value RRSHCCUN H1400019X; label value YEARONE H1400020X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H140, replace; #delimit cr * data file is stored in H140.dta * log file is stored in H140.log log close /************************************************************************************************ NOTES: 1. This program has been tested on Stata Version 10 (for Windows). 2. This program will create a permanent Stata dataset. All additional analyses can be run using this dataset. In addition to the dataset, this program creates a log file named H140.LOG and a data file named H140.DTA. If these files (H140.DTA and H140.LOG) already exist in the working directory, they will be replaced when this program is executed. 3. If the program ends prematurely, the log file will remain open. Before running this program again, the user should enter the following Stata command: log close 4. The cd command assigns C:\MEPS\DATA as the working directory and location of the input ASCII and output .DTA and .LOG files and can be modified by the user as necessary. 5. Stata commands end with a carriage return by default. The command #delimit ; temporarily changes the command ending delimiter from a carriage return to a semicolon. 6. The infix command assumes that the input variables are numeric unless the variable name is prefaced by str. For example, DUPERSID is the a string (or character) variable. ************************************************************************************************/