/************************************************************************************************/ /* Stata User File for HC16HF2 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 */ /* (HC16HF2.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 HC16HF2.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\HC16HF2.DO */ /* The program below will output the Stata dataset HC16HF2.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using HC16HF2.log, replace; clear; * INPUT ALL VARIABLES; infix long DUID 1-5 int PID 6-8 str DUPERSID 9-16 str EVNTIDX 17-28 str HHSFFIDX 29-38 double HHSF97H 39-45 double HHMR97H 46-52 double HHMD97H 53-60 double HHPV97H 61-67 double HHVA97H 68-72 double HHCH97H 73-77 double HHOF97H 78-83 double HHSL97H 84-90 double HHWC97H 91-96 double HHUC97H 97-101 double HHOT97H 102-106 double HHTC97H 107-114 double WTDPER97 115-126 int VARSTR97 127-129 byte VARPSU97 130-131 using HC16HF2.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 REPORTD FLAT FEE ID(UNEDITED)"; label variable HHSF97H "AMT PD, FAMILY(PRE-IMPUTED)"; label variable HHMR97H "AMT PD, MEDICARE(PRE-IMPUTED)"; label variable HHMD97H "AMT PD, MEDICAID(PRE-IMPUTED)"; label variable HHPV97H "AMT PD, PRIV INS(PRE-IMPUTED)"; label variable HHVA97H "AMT PD, VETERANS(PRE-IMPUTED)"; label variable HHCH97H "AMT PD,CHMP/CHPVA(PRE-IMPUTED)"; label variable HHOF97H "AMT PD, OTHER FED(PRE-IMPUTED)"; label variable HHSL97H "AMT PD, STATE/LOC(PRE-IMPUTED)"; label variable HHWC97H "AMT PD, WORK COMP(PRE-IMPUTED)"; label variable HHUC97H "AMT PD,UNCOL LIAB(PRE-IMPUTED)"; label variable HHOT97H "AMT PD, OTH INSUR(PRE-IMPUTED)"; label variable HHTC97H "TOTAL CHARGE(PRE-IMPUTED)"; label variable WTDPER97 "POVERTY/MORTALITY ADJ PERSON LEVL WGT-97"; label variable VARSTR97 "VARIANCE ESTIMATION STRATUM"; label variable VARPSU97 "VARIANCE ESTIMATION PSU 1997"; *DEFINE VALUE LABELS FOR REPORTS; label define HC16HF20001X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20003X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20004X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20005X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20006X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20007X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20008X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20009X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20010X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20011X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; label define HC16HF20012X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 " ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value HHCH97H HC16HF20001X; label value HHMD97H HC16HF20002X; label value HHMR97H HC16HF20003X; label value HHOF97H HC16HF20004X; label value HHOT97H HC16HF20005X; label value HHPV97H HC16HF20006X; label value HHSF97H HC16HF20007X; label value HHSL97H HC16HF20008X; label value HHTC97H HC16HF20009X; label value HHUC97H HC16HF20010X; label value HHVA97H HC16HF20011X; label value HHWC97H HC16HF20012X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save HC16HF2, replace; #delimit cr * data file is stored in HC16HF2.dta * log file is stored in HC16HF2.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 HC16HF2.LOG and a data file named HC16HF2.DTA. If these files (HC16HF2.DTA and HC16HF2.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. ************************************************************************************************/