/************************************************************************************************/ /* Stata User File for H94D 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 */ /* (H94D.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 H94D.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\H94D.DO */ /* The program below will output the Stata dataset H94D.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H94D.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 str FFEEIDX 42-53 byte PANEL 54-55 byte MPCDATA 56-56 int IPBEGYR 57-60 byte IPBEGMM 61-62 byte IPBEGDD 63-64 int IPENDYR 65-68 byte IPENDMM 69-70 byte IPENDDD 71-72 int NUMNIGHX 73-75 byte NUMNIGHT 76-77 byte EMERROOM 78-79 byte SPECCOND 80-81 byte RSNINHOS 82-83 byte ANYOPER 84-85 byte VAPLACE 86-86 str IPICD1X 87-89 str IPICD2X 90-92 str IPICD3X 93-95 str IPICD4X 96-98 str IPPRO1X 99-100 str IPPRO2X 101-102 str IPCCC1X 103-105 str IPCCC2X 106-108 str IPCCC3X 109-111 str IPCCC4X 112-114 byte DSCHPMED 115-116 byte FFIPTYPE 117-118 double IPXP05X 119-127 double IPTC05X 128-137 double IPFSF05X 138-145 double IPFMR05X 146-154 double IPFMD05X 155-163 double IPFPV05X 164-172 double IPFVA05X 173-180 double IPFTR05X 181-188 double IPFOF05X 189-196 double IPFSL05X 197-204 double IPFWC05X 205-212 double IPFOR05X 213-221 double IPFOU05X 222-229 double IPFOT05X 230-237 double IPFXP05X 238-246 double IPFTC05X 247-256 double IPDSF05X 257-263 double IPDMR05X 264-271 double IPDMD05X 272-279 double IPDPV05X 280-287 double IPDVA05X 288-294 double IPDTR05X 295-301 double IPDOF05X 302-307 double IPDSL05X 308-314 double IPDWC05X 315-322 double IPDOR05X 323-329 double IPDOU05X 330-336 double IPDOT05X 337-343 double IPDXP05X 344-351 double IPDTC05X 352-360 byte IMPFLAG 361-361 double PERWT05F 362-373 int VARSTR 374-376 byte VARPSU 377-377 using H94D.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 FFEEIDX "FLAT FEE ID"; 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 VAPLACE "VA FACILITY FLAG"; 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 FFIPTYPE "FLAT FEE BUNDLE"; label variable IPXP05X "TOT EXP FOR EVENT (IPFXP05X+IPDXP05X)"; label variable IPTC05X "TOTAL CHG FOR EVENT (IPFTC05X+IPDTC05X)"; label variable IPFSF05X "FACILITY AMT PD, FAMILY (IMPUTED)"; label variable IPFMR05X "FACILITY AMT PD, MEDICARE (IMPUTED)"; label variable IPFMD05X "FACILITY AMT PD, MEDICAID (IMPUTED)"; label variable IPFPV05X "FACILITY AMT PD, PRIV INSUR (IMPUTED)"; label variable IPFVA05X "FACILITY AMT PD, VETERANS (IMPUTED)"; label variable IPFTR05X "FACILITY AMT PD,TRICARE/CHAMPVA(IMPUTED)"; label variable IPFOF05X "FACILITY AMT PD, OTH FEDERAL (IMPUTED)"; label variable IPFSL05X "FACILITY AMT PD, STATE/LOC GOV (IMPUTED)"; label variable IPFWC05X "FACILITY AMT PD, WORKERS COMP (IMPUTED)"; label variable IPFOR05X "FACILITY AMT PD, OTH PRIV (IMPUTED)"; label variable IPFOU05X "FACILITY AMT PD, OTH PUB (IMPUTED)"; label variable IPFOT05X "FACILITY AMT PD, OTH INSUR (IMPUTED)"; label variable IPFXP05X "FACILITY SUM PAYMENTS IPFSF05X-IPFOT05X"; label variable IPFTC05X "TOTAL FACILITY CHARGE (IMPUTED)"; label variable IPDSF05X "DOCTOR AMOUNT PD, FAMILY (IMPUTED)"; label variable IPDMR05X "DOCTOR AMOUNT PD, MEDICARE (IMPUTED)"; label variable IPDMD05X "DOCTOR AMOUNT PAID, MEDICAID (IMPUTED)"; label variable IPDPV05X "DOCTOR AMT PD, PRIV INSUR (IMPUTED)"; label variable IPDVA05X "DOCTOR AMOUNT PD, VETERANS (IMPUTED)"; label variable IPDTR05X "DOCTOR AMT PD, TRICARE/CHAMPVA (IMPUTED)"; label variable IPDOF05X "DOCTOR AMT PD, OTH FEDERAL (IMPUTED)"; label variable IPDSL05X "DOCTOR AMT PD, STATE/LOC GOV (IMPUTED)"; label variable IPDWC05X "DOCTOR AMOUNT PD, WORKERS COMP (IMPUTED)"; label variable IPDOR05X "DOCTOR AMT PD, OTH PRIVATE (IMPUTED)"; label variable IPDOU05X "DOCTOR AMT PD, OTH PUB (IMPUTED)"; label variable IPDOT05X "DOCTOR AMT PD, OTH INSUR (IMPUTED)"; label variable IPDXP05X "DOCTOR SUM PAYMENTS IPDSF05X-IPDOT05X"; label variable IPDTC05X "TOTAL DOCTOR CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT05F "EXPENDITURE FILE PERSON WEIGHT, 2005"; label variable VARSTR "VARIANCE ESTIMATION STRATUM, 2005"; label variable VARPSU "VARIANCE ESTIMATION PSU, 2005"; *DEFINE VALUE LABELS FOR REPORTS; label define H94D0001X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; label define H94D0002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; label define H94D0003X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; label define H94D0004X 1 "ROUND 1" 2 "ROUND 2" 3 "ROUND 3" 4 "ROUND 4" 5 "ROUND 5" ; label define H94D0005X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 FLAT FEE STEM" 2 "2 FLAT FEE LEAF" ; label define H94D0006X 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 H94D0007X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H94D0008X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H94D0009X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 2004 "2004" 2005 "2005" ; label define H94D0010X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0011X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0012X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0013X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0014X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0015X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0016X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0017X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0018X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0019X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0020X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0021X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0022X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0023X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0024X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H94D0025X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H94D0026X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 2005 "2005" ; label define H94D0027X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0028X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0029X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0030X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0031X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0032X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0033X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0034X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0035X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0036X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0037X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0038X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0039X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0040X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0041X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0042X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H94D0043X 1 "1 HAS MPC DATA" 2 "2 NO MPC DATA" ; label define H94D0044X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" ; label define H94D0045X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0 NUMBER OF NIGHTS" ; label define H94D0046X 10 "PANEL 10" 9 "PANEL 9" ; label define H94D0047X -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 H94D0048X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 YES" 2 "2 NO" ; label define H94D0049X -1 "-1 INAPPLICABLE" 0 "0 NO" 1 "1 YES" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value ANYOPER H94D0001X; label value DSCHPMED H94D0002X; label value EMERROOM H94D0003X; label value EVENTRN H94D0004X; label value FFIPTYPE H94D0005X; label value IMPFLAG H94D0006X; label value IPBEGDD H94D0007X; label value IPBEGMM H94D0008X; label value IPBEGYR H94D0009X; label value IPDMD05X H94D0010X; label value IPDMR05X H94D0011X; label value IPDOF05X H94D0012X; label value IPDOR05X H94D0013X; label value IPDOT05X H94D0014X; label value IPDOU05X H94D0015X; label value IPDPV05X H94D0016X; label value IPDSF05X H94D0017X; label value IPDSL05X H94D0018X; label value IPDTC05X H94D0019X; label value IPDTR05X H94D0020X; label value IPDVA05X H94D0021X; label value IPDWC05X H94D0022X; label value IPDXP05X H94D0023X; label value IPENDDD H94D0024X; label value IPENDMM H94D0025X; label value IPENDYR H94D0026X; label value IPFMD05X H94D0027X; label value IPFMR05X H94D0028X; label value IPFOF05X H94D0029X; label value IPFOR05X H94D0030X; label value IPFOT05X H94D0031X; label value IPFOU05X H94D0032X; label value IPFPV05X H94D0033X; label value IPFSF05X H94D0034X; label value IPFSL05X H94D0035X; label value IPFTC05X H94D0036X; label value IPFTR05X H94D0037X; label value IPFVA05X H94D0038X; label value IPFWC05X H94D0039X; label value IPFXP05X H94D0040X; label value IPTC05X H94D0041X; label value IPXP05X H94D0042X; label value MPCDATA H94D0043X; label value NUMNIGHT H94D0044X; label value NUMNIGHX H94D0045X; label value PANEL H94D0046X; label value RSNINHOS H94D0047X; label value SPECCOND H94D0048X; label value VAPLACE H94D0049X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H94D, replace; #delimit cr * data file is stored in H94D.dta * log file is stored in H94D.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 H94D.LOG and a data file named H94D.DTA. If these files (H94D.DTA and H94D.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. ************************************************************************************************/