/************************************************************************************************/ /* Stata User File for H92 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 */ /* (H92.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 H92.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\H92.DO */ /* The program below will output the Stata dataset H92.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H92.log, replace; clear; * INPUT ALL VARIABLES; infix str DUPERSID 1-8 byte PANEL 9-9 byte INSCAT1 10-11 byte AGESEX 12-13 double LONGWT 14-26 double RRSHCCPV 27-35 double RRSASPV 36-44 double RRSHCCMC 45-53 double RRSASMC 54-62 double RRSHCCMD 63-71 double RRSASMD 72-80 double RRSHCCUN 81-89 double RRSASUN 90-98 double HCCPV 99-107 double ASPV 108-116 double HCCMC 117-125 double ASMC 126-134 double HCCMD 135-143 double ASMD 144-152 byte YEARONE 153-153 using H92.dat; *DEFINE VARIABLE LABELS; label variable DUPERSID "PERSON ID (DUID + PID)"; label variable PANEL "PANEL FLAG"; label variable INSCAT1 "YR 1:TYPE OF INSURANCE COVERAGE"; label variable AGESEX "DXCG AGESEX COMBINED GROUPING"; label variable LONGWT "LONGITUDINAL WEIGHT"; 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, UNINSURED"; label variable RRSASUN "RELATIVE RISK SCORES, AGESEX,UNINSURED"; label variable HCCPV "NOT NRMLZD RISK SCORES,HCC,PRIV&UNINS"; label variable ASPV "NOT NRMLZD RISK SCORES,AGESX,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,AGESX,MCAID,0-64"; label variable YEARONE "INDICATOR IF RECORD HAS YEAR ONE DATA"; *DEFINE VALUE LABELS FOR REPORTS; label define H920001X 1 "1 FEMALE AGE= 0-5" 10 "10 FEMALE AGE=65-69" 11 "11 FEMALE AGE=70-74" 12 "12 FEMALE AGE=75-79" 13 "13 FEMALE AGE=80-84" 14 "14 FEMALE AGE=85-89" 15 "15 FEMALE AGE=90-94" 16 "16 FEMALE AGE=95+" 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" 26 "26 MALE AGE=65-69" 27 "27 MALE AGE=70-74" 28 "28 MALE AGE=75-79" 29 "29 MALE AGE=80-84" 3 "3 FEMALE AGE=13-17" 30 "30 MALE AGE=85-89" 31 "31 MALE AGE=90-94" 32 "32 MALE AGE=95+" 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 H920002X -1 "-1 N/A" 1 "1 MEDICARE" 2 "2 PRIVATE" 3 "3 MEDICAID" 4 "4 UNINSURED" ; label define H920003X 1 "1 PANEL 1 (1996-1997)" 2 "2 PANEL 2 (1997-1998)" 3 "3 PANEL 3 (1998-1999)" 4 "4 PANEL 4 (1999-2000)" 5 "5 PANEL 5 (2000-2001)" 6 "6 PANEL 6 (2001-2002)" 7 "7 PANEL 7 (2002-2003)" 8 "8 PANEL 8 (2003-2004)" 9 "9 PANEL 9 (2004-2005)" ; label define H920004X 1 "1 RECORD HAS YEAR ONE DATA" 2 "2 RECORD DOES NOT HAVE YEAR ONE DATA" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value AGESEX H920001X; label value INSCAT1 H920002X; label value PANEL H920003X; label value YEARONE H920004X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H92, replace; #delimit cr * data file is stored in H92.dta * log file is stored in H92.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 H92.LOG and a data file named H92.DTA. If these files (H92.DTA and H92.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. ************************************************************************************************/