/************************************************************************************************/ /* Stata User File for HC10HF2 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 */ /* (HC10HF2.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 HC10HF2.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\HC10HF2.DO */ /* The program below will output the Stata dataset HC10HF2.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using HC10HF2.log, replace; clear; * INPUT ALL VARIABLES; infix long DUID 1-5 byte PID 6-7 str DUPERSID 8-15 str EVNTIDX 16-27 str HHSFFIDX 28-37 double HHSF96H 38-44 double HHMR96H 45-51 double HHMD96H 52-58 double HHPV96H 59-65 double HHVA96H 66-71 double HHCH96H 72-76 double HHOF96H 77-82 double HHSL96H 83-89 double HHWC96H 90-94 double HHOT96H 95-99 double HHUC96H 100-104 double HHTC96H 105-112 double WTDPER96 113-124 byte VARPSU96 125-126 int VARSTR96 127-129 using HC10HF2.dat; *DEFINE VARIABLE LABELS; label variable DUID "DWELLING UNIT ID"; label variable PID "PERSON NUMBER"; label variable DUPERSID "PERSON ID (DUID+PID)"; label variable EVNTIDX "EVENT ID"; label variable HHSFFIDX "HOUSEHOLD REPORTED FLAT FEE ID"; label variable HHSF96H "HHLD RPTD AMT PD, FAMILY (PRE-IMPUTED)"; label variable HHMR96H "HHLD RPTD AMT PD, MEDICARE(PRE-IMPUTED)"; label variable HHMD96H "HHLD RPTD AMT PD, MEDICAID(PRE-IMPUTED)"; label variable HHPV96H "HHLD RPTD AMT PD, PRIV INS(PRE-IMPUTED)"; label variable HHVA96H "HHLD RPTD AMT PD, VETERANS(PRE-IMPUTED)"; label variable HHCH96H "HHLD RPTD AMT PD,CHMP/CHMPVA(PRE-IMPUTD)"; label variable HHOF96H "HHLD RPTD AMT PD, OTHER FED(PRE-IMPUTED)"; label variable HHSL96H "HHLD RPTD AMT PD, STATE&LOC(PRE-IMPUTED)"; label variable HHWC96H "HHLD RPTD AMT PD, WORK COMP(PRE-IMPUTED)"; label variable HHOT96H "HHLD RPTD AMT PD, OTH INSUR(PRE-IMPUTED)"; label variable HHUC96H "HHLD RPTD AMT PD,UNCOL LIAB(PRE-IMPUTED)"; label variable HHTC96H "HHLD REPORTED TOTAL CHARGE (PRE-IMPUTED)"; label variable WTDPER96 "POVERTY/MORTALITY ADJUSTED PERS LEVL WGT"; label variable VARPSU96 "VARIANCE ESTIMATION PSU 1996"; label variable VARSTR96 "VARIANCE ESTIMATION STRATUM 1996"; *DEFINE VALUE LABELS FOR REPORTS; label define HC10HF20001X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20003X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20004X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20005X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20006X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20007X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20008X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20009X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20010X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define HC10HF20011X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" 200 "$200.00 - $200.00" ; label define HC10HF20012X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value HHCH96H HC10HF20001X; label value HHMD96H HC10HF20002X; label value HHMR96H HC10HF20003X; label value HHOF96H HC10HF20004X; label value HHOT96H HC10HF20005X; label value HHPV96H HC10HF20006X; label value HHSF96H HC10HF20007X; label value HHSL96H HC10HF20008X; label value HHTC96H HC10HF20009X; label value HHUC96H HC10HF20010X; label value HHVA96H HC10HF20011X; label value HHWC96H HC10HF20012X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save HC10HF2, replace; #delimit cr * data file is stored in HC10HF2.dta * log file is stored in HC10HF2.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 HC10HF2.LOG and a data file named HC10HF2.DTA. If these files (HC10HF2.DTA and HC10HF2.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. ************************************************************************************************/