/************************************************************************************************/ /* Stata User File for H26F 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 */ /* (H26F.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 H26F.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\H26F.DO */ /* The program below will output the Stata dataset H26F.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H26FF2.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 OPSF98H 39-45 double OPMR98H 46-53 double OPMD98H 54-58 double OPPV98H 59-66 double OPVA98H 67-71 double OPCH98H 72-77 double OPOF98H 78-83 double OPSL98H 84-90 double OPWC98H 91-97 double OPOT98H 98-104 double OPUC98H 105-110 double OPTC98H 111-118 double OPSF98M 119-125 double OPMR98M 126-133 double OPMD98M 134-140 double OPPV98M 141-148 double OPVA98M 149-153 double OPCH98M 154-160 double OPOF98M 161-165 double OPSL98M 166-171 double OPWC98M 172-178 double OPOT98M 179-185 double OPTC98M 186-193 double WTDPER98 194-205 byte VARPSU98 206-207 int VARSTR98 208-210 using H26FF2.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 (UNEDTED)"; label variable OPSF98H "HHLD RPTD AMT PD, FAMILY(PRE-IMPUTED)"; label variable OPMR98H "HHLD RPTD AMT PD, MEDICARE(PRE-IMPUTED)"; label variable OPMD98H "HHLD RPTD AMT PD, MEDICAID(PRE-IMPUTED)"; label variable OPPV98H "HHLD RPTD AMT PD, PRIV INS(PRE-IMPUTED)"; label variable OPVA98H "HHLD RPTD AMT PD, VETERANS(PRE-IMPUTED)"; label variable OPCH98H "HHLD RPTD AMT PD, CHMP/CHVA(PRE-IMPUTED)"; label variable OPOF98H "HHLD RPTD AMT PD, OTHER FED(PRE-IMPUTED)"; label variable OPSL98H "HHLD RPTD AMT PD, STATE/LOC(PRE-IMPUTED)"; label variable OPWC98H "HHLD RPTD AMT PD, WORK COMP(PRE-IMPUTED)"; label variable OPOT98H "HHLD RPTD AMT PD, OTH INSUR(PRE-IMPUTED)"; label variable OPUC98H "HHLD RPTD AMT PD, UNCOL LIAB(PRE-IMPUTD)"; label variable OPTC98H "HHLD REPORTED TOTAL CHARGE(PRE-IMPUTED)"; label variable OPSF98M "MPC RPTD AMT PD, FAMILY(UN-IMPUTED)"; label variable OPMR98M "MPC RPTD AMT PD, MEDICARE(UN-IMPUTED)"; label variable OPMD98M "MPC RPTD AMT PD, MEDICAID(UN-IMPUTED)"; label variable OPPV98M "MPC RPTD AMT PD, PRIV INS(UN-IMPUTED)"; label variable OPVA98M "MPC RPTD AMT PD, VETERANS(UN-IMPUTED)"; label variable OPCH98M "MPC RPTD AMT PD, CHMP/CHMPVA(UN-IMPUTED)"; label variable OPOF98M "MPC RPTD AMT PD, OTHER FED(UN-IMPUTED)"; label variable OPSL98M "MPC RPTD AMT PD, STATE & LOC(UN-IMPUTED)"; label variable OPWC98M "MPC RPTD AMT PD, WORK COMPU(UN-IMPUTED)"; label variable OPOT98M "MPC RPTD AMT PD,OTH INSUR(UN-IMPUTED)"; label variable OPTC98M "MPC REPORTED TOTAL CHARGE(UN-IMPUTED)"; label variable WTDPER98 "POVERTY/MORTALITY ADJ PERS LEVL WGT 98"; label variable VARPSU98 "VARIANCE ESTIMATION PSU,1998"; label variable VARSTR98 "VARIANCE ESTIMATION STRATUM,1998"; *DEFINE VALUE LABELS FOR REPORTS; label define H26FF20001X -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" 0 "0" ; label define H26FF20002X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20003X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20004X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20005X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20006X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20007X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20008X -9 "-9 NOT ASCERTAINED" 0 "0" 690 "$690.00" ; label define H26FF20009X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20010X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20011X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20012X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20013X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20014X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20015X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20016X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20017X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20018X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20019X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20020X -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" 218 "$218.00" ; label define H26FF20021X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20022X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20023X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20024X -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H26FF20025X -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" 0 "0" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value DUID H26FF20001X; label value OPCH98H H26FF20002X; label value OPCH98M H26FF20003X; label value OPMD98H H26FF20004X; label value OPMD98M H26FF20005X; label value OPMR98H H26FF20006X; label value OPMR98M H26FF20007X; label value OPOF98H H26FF20008X; label value OPOF98M H26FF20009X; label value OPOT98H H26FF20010X; label value OPOT98M H26FF20011X; label value OPPV98H H26FF20012X; label value OPPV98M H26FF20013X; label value OPSF98H H26FF20014X; label value OPSF98M H26FF20015X; label value OPSL98H H26FF20016X; label value OPSL98M H26FF20017X; label value OPTC98H H26FF20018X; label value OPTC98M H26FF20019X; label value OPUC98H H26FF20020X; label value OPVA98H H26FF20021X; label value OPVA98M H26FF20022X; label value OPWC98H H26FF20023X; label value OPWC98M H26FF20024X; label value PID H26FF20025X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H26FF2, replace; #delimit cr * data file is stored in H26FF2.dta * log file is stored in H26FF2.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 H26F.LOG and a data file named H26F.DTA. If these files (H26F.DTA and H26F.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. ************************************************************************************************/