/************************************************************************************************/ /* Stata User File for H26B 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 */ /* (H26B.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 H26B.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\H26B.DO */ /* The program below will output the Stata dataset H26B.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H26BF2.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 DVSF98H 39-45 double DVMR98H 46-51 double DVMD98H 52-56 double DVPV98H 57-63 double DVVA98H 64-68 double DVCH98H 69-74 double DVOF98H 75-81 double DVSL98H 82-88 double DVWC98H 89-93 double DVOT98H 94-100 double DVUC98H 101-106 double DVTC98H 107-113 double WTDPER98 114-125 int VARSTR98 126-128 byte VARPSU98 129-130 using H26BF2.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 DVSF98H "HHLD RPTD AMT PD, FAMILY(PRE-IMPUTED)"; label variable DVMR98H "HHLD RPTD AMT PD, MEDICARE(PRE-IMPUTED)"; label variable DVMD98H "HHLD RPTD AMT PD, MEDICAID(PRE-IMPUTED)"; label variable DVPV98H "HHLD RPTD AMT PD, PRIV INS(PRE-IMPUTED)"; label variable DVVA98H "HHLD RPTD AMT PD, VETERANS(PRE-IMPUTED)"; label variable DVCH98H "HHLD RPTD AMT PD,CHMP/CHPVA(PRE-IMPUTED)"; label variable DVOF98H "HHLD RPTD AMT PD, OTHER FED(PRE-IMPUTED)"; label variable DVSL98H "HHLD RPTD AMT PD, STATE/LOC(PRE-IMPUTED)"; label variable DVWC98H "HHLD RPTD AMT PD, WORK COMP(PRE-IMPUTED)"; label variable DVOT98H "HHLD RPTD AMT PD, OTH INSUR(PRE-IMPUTED)"; label variable DVUC98H "HHLD RPTD AMT PD,UNCOL LIAB(PRE-IMPUTED)"; label variable DVTC98H "HHLD REPORTED TOTAL CHARGE(PRE-IMPUTED)"; label variable WTDPER98 "POVERTY/MORTALITY/NH ADJ PERS LVL WGT 98"; label variable VARSTR98 "VARIANCE ESTIMATION STRATUM,1998"; label variable VARPSU98 "VARIANCE ESTIMATION PSU,1998"; *DEFINE VALUE LABELS FOR REPORTS; label define H26BF20001X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20002X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20003X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20004X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20005X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20006X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20007X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20008X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20009X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20010X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" 350 "$350.01 - $350.00" ; label define H26BF20011X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26BF20012X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value DVCH98H H26BF20001X; label value DVMD98H H26BF20002X; label value DVMR98H H26BF20003X; label value DVOF98H H26BF20004X; label value DVOT98H H26BF20005X; label value DVPV98H H26BF20006X; label value DVSF98H H26BF20007X; label value DVSL98H H26BF20008X; label value DVTC98H H26BF20009X; label value DVUC98H H26BF20010X; label value DVVA98H H26BF20011X; label value DVWC98H H26BF20012X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H26BF2, replace; #delimit cr * data file is stored in H26BF2.dta * log file is stored in H26BF2.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 H26B.LOG and a data file named H26B.DTA. If these files (H26B.DTA and H26B.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. ************************************************************************************************/