/************************************************************************************************/ /* Stata User File for H110D 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 */ /* (H110D.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 H110D.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\H110D.DO */ /* The program below will output the Stata dataset H110D.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H110D.log, replace; clear; * INPUT ALL VARIABLES; infix long DUID 1-5 int PID 6-8 str DUPERSID 9-16 str EVNTIDX 17-28 byte EVENTRN 29-29 str ERHEVIDX 30-41 byte PANEL 42-43 byte MPCDATA 44-44 int IPBEGYR 45-48 byte IPBEGMM 49-50 byte IPBEGDD 51-52 int IPENDYR 53-56 byte IPENDMM 57-58 byte IPENDDD 59-60 int NUMNIGHX 61-63 byte NUMNIGHT 64-65 byte EMERROOM 66-67 byte SPECCOND 68-69 byte RSNINHOS 70-71 byte ANYOPER 72-73 str IPICD1X 74-76 str IPICD2X 77-79 str IPICD3X 80-82 str IPICD4X 83-85 str IPPRO1X 86-87 str IPPRO2X 88-89 str IPCCC1X 90-92 str IPCCC2X 93-95 str IPCCC3X 96-98 str IPCCC4X 99-101 byte DSCHPMED 102-103 double IPXP07X 104-112 double IPTC07X 113-122 double IPFSF07X 123-130 double IPFMR07X 131-139 double IPFMD07X 140-148 double IPFPV07X 149-157 double IPFVA07X 158-165 double IPFTR07X 166-173 double IPFOF07X 174-181 double IPFSL07X 182-189 double IPFWC07X 190-197 double IPFOR07X 198-205 double IPFOU07X 206-214 double IPFOT07X 215-223 double IPFXP07X 224-232 double IPFTC07X 233-242 double IPDSF07X 243-249 double IPDMR07X 250-257 double IPDMD07X 258-265 double IPDPV07X 266-273 double IPDVA07X 274-279 double IPDTR07X 280-286 double IPDOF07X 287-291 double IPDSL07X 292-298 double IPDWC07X 299-306 double IPDOR07X 307-314 double IPDOU07X 315-321 double IPDOT07X 322-329 double IPDXP07X 330-337 double IPDTC07X 338-345 byte IMPFLAG 346-346 double PERWT07F 347-358 int VARSTR 359-362 byte VARPSU 363-363 using H110D.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 EVENTRN "EVENT ROUND NUMBER"; label variable ERHEVIDX "EVENT ID FOR CORRESPONDING EMER RM VISIT"; label variable PANEL "PANEL NUMBER"; label variable MPCDATA "MPC DATA FLAG"; label variable IPBEGYR "EVENT START DATE - YEAR"; label variable IPBEGMM "EVENT START DATE - MONTH"; label variable IPBEGDD "EVENT START DATE - DAY"; label variable IPENDYR "EVENT END DATE - YEAR"; label variable IPENDMM "EVENT END DATE - MONTH"; label variable IPENDDD "EVENT END DATE - DAY"; label variable NUMNIGHX "# OF NIGHTS IN HOSPITAL - EDITED/IMPUTED"; label variable NUMNIGHT "NUMBER OF NIGHTS STAYED AT PROVIDER"; label variable EMERROOM "DID STAY BEGIN WITH EMERGENCY ROOM VISIT"; label variable SPECCOND "HOSPITAL STAY RELATED TO CONDITION"; label variable RSNINHOS "REASON ENTERED HOSPITAL"; label variable ANYOPER "ANY OPERATIONS OR SURGERIES PERFORMED"; label variable IPICD1X "3-DIGIT ICD-9-CM CONDITION CODE"; label variable IPICD2X "3-DIGIT ICD-9-CM CONDITION CODE"; label variable IPICD3X "3-DIGIT ICD-9-CM CONDITION CODE"; label variable IPICD4X "3-DIGIT ICD-9-CM CONDITION CODE"; label variable IPPRO1X "2-DIGIT ICD-9-CM PROCEDURE CODE"; label variable IPPRO2X "2-DIGIT ICD-9-CM PROCEDURE CODE"; label variable IPCCC1X "MODIFIED CLINICAL CLASSIFICATION CODE"; label variable IPCCC2X "MODIFIED CLINICAL CLASSIFICATION CODE"; label variable IPCCC3X "MODIFIED CLINICAL CLASSIFICATION CODE"; label variable IPCCC4X "MODIFIED CLINICAL CLASSIFICATION CODE"; label variable DSCHPMED "MEDICINES PRESCRIBED AT DISCHARGE"; label variable IPXP07X "TOT EXP FOR EVENT (IPFXP07X+IPDXP07X)"; label variable IPTC07X "TOTAL CHG FOR EVENT (IPFTC07X+IPDTC07X)"; label variable IPFSF07X "FACILITY AMT PD, FAMILY (IMPUTED)"; label variable IPFMR07X "FACILITY AMT PD, MEDICARE (IMPUTED)"; label variable IPFMD07X "FACILITY AMT PD, MEDICAID (IMPUTED)"; label variable IPFPV07X "FACILITY AMT PD, PRIV INSUR (IMPUTED)"; label variable IPFVA07X "FACILITY AMT PD, VETERANS (IMPUTED)"; label variable IPFTR07X "FACILITY AMT PD,TRICARE/CHAMPVA(IMPUTED)"; label variable IPFOF07X "FACILITY AMT PD, OTH FEDERAL (IMPUTED)"; label variable IPFSL07X "FACILITY AMT PD, STATE/LOC GOV (IMPUTED)"; label variable IPFWC07X "FACILITY AMT PD, WORKERS COMP (IMPUTED)"; label variable IPFOR07X "FACILITY AMT PD, OTH PRIV (IMPUTED)"; label variable IPFOU07X "FACILITY AMT PD, OTH PUB (IMPUTED)"; label variable IPFOT07X "FACILITY AMT PD, OTH INSUR (IMPUTED)"; label variable IPFXP07X "FACILITY SUM PAYMENTS IPFSF07X-IPFOT07X"; label variable IPFTC07X "TOTAL FACILITY CHARGE (IMPUTED)"; label variable IPDSF07X "DOCTOR AMOUNT PD, FAMILY (IMPUTED)"; label variable IPDMR07X "DOCTOR AMOUNT PD, MEDICARE (IMPUTED)"; label variable IPDMD07X "DOCTOR AMOUNT PAID, MEDICAID (IMPUTED)"; label variable IPDPV07X "DOCTOR AMT PD, PRIV INSUR (IMPUTED)"; label variable IPDVA07X "DOCTOR AMOUNT PD, VETERANS (IMPUTED)"; label variable IPDTR07X "DOCTOR AMT PD, TRICARE/CHAMPVA (IMPUTED)"; label variable IPDOF07X "DOCTOR AMT PD, OTH FEDERAL (IMPUTED)"; label variable IPDSL07X "DOCTOR AMT PD, STATE/LOC GOV (IMPUTED)"; label variable IPDWC07X "DOCTOR AMOUNT PD, WORKERS COMP (IMPUTED)"; label variable IPDOR07X "DOCTOR AMT PD, OTH PRIVATE (IMPUTED)"; label variable IPDOU07X "DOCTOR AMT PD, OTH PUB (IMPUTED)"; label variable IPDOT07X "DOCTOR AMT PD, OTH INSUR (IMPUTED)"; label variable IPDXP07X "DOCTOR SUM PAYMENTS IPDSF07X-IPDOT07X"; label variable IPDTC07X "TOTAL DOCTOR CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT07F "EXPENDITURE FILE PERSON WEIGHT, 2007"; label variable VARSTR "VARIANCE ESTIMATION STRATUM, 2007"; label variable VARPSU "VARIANCE ESTIMATION PSU, 2007"; *DEFINE VALUE LABELS FOR REPORTS; label define H110D0001X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; label define H110D0002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; label define H110D0003X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; label define H110D0004X 1 "ROUND 1" 2 "ROUND 2" 3 "ROUND 3" 4 "ROUND 4" 5 "ROUND 5" ; label define H110D0005X 0 "0 NOT ELIGIBLE FOR IMPUTATION" 1 "1 COMPLETE HC DATA" 2 "2 COMPLETE MPC DATA" 3 "3 FULLY IMPUTED" 4 "4 PARTIALLY IMPUTED" 5 "5 CAPITATION IMPUTATION" ; label define H110D0006X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H110D0007X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H110D0008X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 2006 "2006" 2007 "2007" ; label define H110D0009X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0010X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0011X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" 89.89 "$1.00 - $89.89" ; label define H110D0012X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0013X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0014X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0015X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0016X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0017X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0018X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0019X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0020X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0021X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0022X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0023X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H110D0024X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H110D0025X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 2007 "2007" ; label define H110D0026X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0027X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0028X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0029X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0030X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0031X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0032X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0033X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0034X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0035X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0036X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0037X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0038X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0039X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0040X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0041X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H110D0042X 1 "1 HAS MPC DATA" 2 "2 NO MPC DATA" ; label define H110D0043X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H110D0044X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 NUMBER OF NIGHTS" ; label define H110D0045X 11 "PANEL 11" 12 "PANEL 12" ; label define H110D0046X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 OPERATION OR SURGICAL PROCEDURE" 2 "2 TREATMENT/THERAPY" 3 "3 DIAGNOSTIC TESTS ONLY" 4 "4 GIVE BIRTH TO A BABY (MOTHER)" 5 "5 TO BE BORN (BABY)" 91 "91 OTHER (SPECIFY)" ; label define H110D0047X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value ANYOPER H110D0001X; label value DSCHPMED H110D0002X; label value EMERROOM H110D0003X; label value EVENTRN H110D0004X; label value IMPFLAG H110D0005X; label value IPBEGDD H110D0006X; label value IPBEGMM H110D0007X; label value IPBEGYR H110D0008X; label value IPDMD07X H110D0009X; label value IPDMR07X H110D0010X; label value IPDOF07X H110D0011X; label value IPDOR07X H110D0012X; label value IPDOT07X H110D0013X; label value IPDOU07X H110D0014X; label value IPDPV07X H110D0015X; label value IPDSF07X H110D0016X; label value IPDSL07X H110D0017X; label value IPDTC07X H110D0018X; label value IPDTR07X H110D0019X; label value IPDVA07X H110D0020X; label value IPDWC07X H110D0021X; label value IPDXP07X H110D0022X; label value IPENDDD H110D0023X; label value IPENDMM H110D0024X; label value IPENDYR H110D0025X; label value IPFMD07X H110D0026X; label value IPFMR07X H110D0027X; label value IPFOF07X H110D0028X; label value IPFOR07X H110D0029X; label value IPFOT07X H110D0030X; label value IPFOU07X H110D0031X; label value IPFPV07X H110D0032X; label value IPFSF07X H110D0033X; label value IPFSL07X H110D0034X; label value IPFTC07X H110D0035X; label value IPFTR07X H110D0036X; label value IPFVA07X H110D0037X; label value IPFWC07X H110D0038X; label value IPFXP07X H110D0039X; label value IPTC07X H110D0040X; label value IPXP07X H110D0041X; label value MPCDATA H110D0042X; label value NUMNIGHT H110D0043X; label value NUMNIGHX H110D0044X; label value PANEL H110D0045X; label value RSNINHOS H110D0046X; label value SPECCOND H110D0047X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H110D, replace; #delimit cr * data file is stored in H110D.dta * log file is stored in H110D.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 H110D.LOG and a data file named H110D.DTA. If these files (H110D.DTA and H110D.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. ************************************************************************************************/