/************************************************************************************************/ /* Stata User File for HC10BF2 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 */ /* (HC10BF2.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 HC10BF2.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\HC10BF2.DO */ /* The program below will output the Stata dataset HC10BF2.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using HC10BF2.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-39 double DVSF96H 40-46 double DVMR96H 47-52 double DVMD96H 53-57 double DVPV96H 58-64 double DVVA96H 65-69 double DVCH96H 70-75 double DVOF96H 76-81 double DVSL96H 82-88 double DVWC96H 89-93 double DVOT96H 94-100 double DVUC96H 101-106 double DVTC96H 107-114 double WTDPER96 115-126 byte VARPSU96 127-128 int VARSTR96 129-131 using HC10BF2.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 DVSF96H "HHLD RPTD AMT PD,FAMILY(PRE-IMPUTED)"; label variable DVMR96H "HHLD RPTD AMT PD,MEDICARE(PRE-IMPUTED)"; label variable DVMD96H "HHLD RPTD AMT PD,MEDICAID(PRE-IMPUTED)"; label variable DVPV96H "HHLD RPTD AMT PD,PRIV INS(PRE-IMPUTED)"; label variable DVVA96H "HHLD RPTD AMT PD,VETERANS(PRE-IMPUTED)"; label variable DVCH96H "HHLD RPTD AMTPD,CHMP/CHMPVA(PRE-IMPUTED)"; label variable DVOF96H "HHLD RPTD AMT PD,OTHER FED(PRE-IMPUTED)"; label variable DVSL96H "HHLD RPTD AMT PD,STATE & LOC(PRE-IMPUTD)"; label variable DVWC96H "HHLD RPTD AMT PD,WORK COMP(PRE-IMPUTED)"; label variable DVOT96H "HHLD RPTD AMT PD,OTH INSUR(PRE-IMPUTED)"; label variable DVUC96H "HHLD RPTD AMT PD,UNCOL LIAB(PRE-IMPUTED)"; label variable DVTC96H "HHLD REPORTED TOTAL CHARGE(PRE-IMPUTED)"; label variable WTDPER96 "POVERTY/MORTALITY ADJ PERS WEIGHT, 1996"; label variable VARPSU96 "VARIANCE ESTIMATION PSU,1996"; label variable VARSTR96 "VARIANCE ESTIMATION STRATUM,1996"; *DEFINE VALUE LABELS FOR REPORTS; label define HC10BF20001X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define HC10BF20002X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20003X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20004X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20005X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20006X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20007X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20008X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0 " ; label define HC10BF20009X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20010X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20011X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20012X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" ; label define HC10BF20013X -1 "-1 INAPPLICABLE" -4 "-4 FAMILY FLAT FEE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 " 0" 53 "$53.00" ; label define HC10BF20014X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value DUID HC10BF20001X; label value DVCH96H HC10BF20002X; label value DVMD96H HC10BF20003X; label value DVMR96H HC10BF20004X; label value DVOF96H HC10BF20005X; label value DVOT96H HC10BF20006X; label value DVPV96H HC10BF20007X; label value DVSF96H HC10BF20008X; label value DVSL96H HC10BF20009X; label value DVTC96H HC10BF20010X; label value DVUC96H HC10BF20011X; label value DVVA96H HC10BF20012X; label value DVWC96H HC10BF20013X; label value PID HC10BF20014X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save HC10BF2, replace; #delimit cr * data file is stored in HC10BF2.dta * log file is stored in HC10BF2.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 HC10BF2.LOG and a data file named HC10BF2.DTA. If these files (HC10BF2.DTA and HC10BF2.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. ************************************************************************************************/