/************************************************************************************************/ /* Stata User File for H26C 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 */ /* (H26C.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 H26C.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\H26C.DO */ /* The program below will output the Stata dataset H26C.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H26CF2.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-40 double OMSF98H 41-48 double OMMR98H 49-56 double OMMD98H 57-61 double OMPV98H 62-68 double OMVA98H 69-73 double OMCH98H 74-78 double OMOF98H 79-83 double OMSL98H 84-90 double OMWC98H 91-96 double OMOT98H 97-102 double OMUC98H 103-107 double OMTC98H 108-115 double WTDPER98 116-127 int VARSTR98 128-130 byte VARPSU98 131-132 using H26CF2.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(UNEDITED)"; label variable OMSF98H "HHLD RPTD AMT PD, FAMILY(PRE-IMPUTED)"; label variable OMMR98H "HHLD RPTD AMT PD, MEDICARE(PRE-IMPUTED)"; label variable OMMD98H "HHLD RPTD AMT PD, MEDICAID(PRE-IMPUTED)"; label variable OMPV98H "HHLD RPTD AMT PD, PRIV INS(PRE-IMPUTED)"; label variable OMVA98H "HHLD RPTD AMT PD, VETERANS(PRE-IMPUTED)"; label variable OMCH98H "HHLD RPTD AMT PD,CHMP/CHPVA(PRE-IMPUTED)"; label variable OMOF98H "HHLD RPTD AMT PD, OTHER FED(PRE-IMPUTED)"; label variable OMSL98H "HHLD RPTD AMT PD, STATE/LOC(PRE-IMPUTED)"; label variable OMWC98H "HHLD RPTD AMT PD, WORK COMP(PRE-IMPUTED)"; label variable OMOT98H "HHLD RPTD AMT PD, OTH INSUR(PRE-IMPUTED)"; label variable OMUC98H "HHLD RPTD AMT PD,UNCOL LIAB(PRE-IMPUTED)"; label variable OMTC98H "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 H26CF20001X -1 "-1 INAPPLICABLE" -2 "-2 DETERMINED IN PREVIOUS ROUND" -3 "-3 NO DATA IN ROUND" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H26CF20002X -9 "-9 NOT ASCERTAINED" 0 "0" 10 "$10.00" ; label define H26CF20003X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20004X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20005X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20006X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20007X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20008X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20009X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20010X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20011X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" 34 "$34.00" ; label define H26CF20012X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26CF20013X -9 "-9 NOT ASCERTAINED" 0 "0" 652 "$652.00" ; label define H26CF20014X -1 "-1 INAPPLICABLE" -2 "-2 DETERMINED IN PREVIOUS ROUND" -3 "-3 NO DATA IN ROUND" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value DUID H26CF20001X; label value OMCH98H H26CF20002X; label value OMMD98H H26CF20003X; label value OMMR98H H26CF20004X; label value OMOF98H H26CF20005X; label value OMOT98H H26CF20006X; label value OMPV98H H26CF20007X; label value OMSF98H H26CF20008X; label value OMSL98H H26CF20009X; label value OMTC98H H26CF20010X; label value OMUC98H H26CF20011X; label value OMVA98H H26CF20012X; label value OMWC98H H26CF20013X; label value PID H26CF20014X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H26CF2, replace; #delimit cr * data file is stored in H26CF2.dta * log file is stored in H26CF2.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 H26C.LOG and a data file named H26C.DTA. If these files (H26C.DTA and H26C.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. ************************************************************************************************/