/************************************************************************************************/ /* Stata User File for H67C 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 */ /* (H67C.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 H67C.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\H67C.DO */ /* The program below will output the Stata dataset H67C.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H67C.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 FFEEIDX 30-41 byte OMTYPEX 42-43 byte OMTYPE 44-45 str OMOTHOX 46-70 str OMOTHOS 71-95 byte FFOMTYPE 96-97 byte FFBEF02 98-99 byte FFTOT03 100-101 double OMSF02X 102-109 double OMMR02X 110-116 double OMMD02X 117-123 double OMPV02X 124-131 double OMVA02X 132-138 double OMTR02X 139-145 double OMOF02X 146-151 double OMSL02X 152-158 double OMWC02X 159-164 double OMOR02X 165-171 double OMOU02X 172-177 double OMOT02X 178-184 double OMXP02X 185-192 double OMTC02X 193-200 byte IMPFLAG 201-201 double PERWT02F 202-213 int VARSTR 214-216 byte VARPSU 217-217 using H67C.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 FFEEIDX "FLAT FEE ID"; label variable OMTYPEX "OTHER MEDICAL EXPENSE TYPE - EDITED"; label variable OMTYPE "OTHER MEDICAL EXPENSE TYPE"; label variable OMOTHOX "OMTYPE OTHER SPECIFY - EDITED"; label variable OMOTHOS "OMTYPE OTHER SPECIFY"; label variable FFOMTYPE "FLAT FEE BUNDLE"; label variable FFBEF02 "TOTAL # OF VISITS IN FF BEFORE 2002"; label variable FFTOT03 "TOTAL # OF VISITS IN FF AFTER 2002"; label variable OMSF02X "AMOUNT PAID, FAMILY (IMPUTED)"; label variable OMMR02X "AMOUNT PAID, MEDICARE (IMPUTED)"; label variable OMMD02X "AMOUNT PAID, MEDICAID (IMPUTED)"; label variable OMPV02X "AMOUNT PAID, PRIVATE INSURANCE (IMPUTED)"; label variable OMVA02X "AMOUNT PAID, VETERANS (IMPUTED)"; label variable OMTR02X "AMOUNT PAID, TRICARE (IMPUTED)"; label variable OMOF02X "AMOUNT PAID, OTHER FEDERAL (IMPUTED)"; label variable OMSL02X "AMOUNT PAID, STATE & LOCAL GOV (IMPUTED)"; label variable OMWC02X "AMOUNT PAID, WORKERS COMP (IMPUTED)"; label variable OMOR02X "AMOUNT PAID, OTHER PRIVATE (IMPUTED)"; label variable OMOU02X "AMOUNT PAID, OTHER PUBLIC (IMPUTED)"; label variable OMOT02X "AMOUNT PAID, OTHER INSURANCE (IMPUTED)"; label variable OMXP02X "SUM OF OMSF02X-OMOT02X (IMPUTED)"; label variable OMTC02X "HHLD REPORTED TOTAL CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT02F "EXPENDITURE FILE PERSON WEIGHT, 2002"; label variable VARSTR "VARIANCE ESTIMATION STRATUM, 2002"; label variable VARPSU "VARIANCE ESTIMATION PSU, 2002"; *DEFINE VALUE LABELS FOR REPORTS; label define H67C0001X 1 "ROUND 1" 2 "ROUND 2" 3 "ROUND 3" 4 "ROUND 4" 5 "ROUND 5" ; label define H67C0002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0003X -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 H67C0004X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0005X -1 "-1 INAPPLICABLE" 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 H67C0006X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0007X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0008X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0009X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0010X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0011X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0012X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0013X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0014X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0015X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0016X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0017X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 GLASSES OR CONTACT LENSES" 10 "10 DISPOSABLE SUPPLIES" 11 "11 ALTERATIONS/MODIFICATIONS" 2 "2 INSULIN" 3 "3 DIABETIC EQUIPMENT/SUPPLIES" 4 "4 AMBULANCE SERVICES" 5 "5 ORTHOPEDIC ITEMS" 6 "6 HEARING DEVICES" 7 "7 PROSTHESIS" 8 "8 BATHROOM AIDS" 9 "9 MEDICAL EQUIPMENT" 91 "91 OTHER" ; label define H67C0018X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 1 "1 GLASSES OR CONTACT LENSES" 10 "10 DISPOSABLE SUPPLIES" 11 "11 ALTERATIONS/MODIFICATIONS" 2 "2 INSULIN" 3 "3 DIABETIC EQUIPMENT/SUPPLIES" 4 "4 AMBULANCE SERVICES" 5 "5 ORTHOPEDIC ITEMS" 6 "6 HEARING DEVICES" 7 "7 PROSTHESIS" 8 "8 BATHROOM AIDS" 9 "9 MEDICAL EQUIPMENT" 91 "91 OTHER" ; label define H67C0019X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0020X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H67C0021X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value EVENTRN H67C0001X; label value FFBEF02 H67C0002X; label value FFOMTYPE H67C0003X; label value FFTOT03 H67C0004X; label value IMPFLAG H67C0005X; label value OMMD02X H67C0006X; label value OMMR02X H67C0007X; label value OMOF02X H67C0008X; label value OMOR02X H67C0009X; label value OMOT02X H67C0010X; label value OMOU02X H67C0011X; label value OMPV02X H67C0012X; label value OMSF02X H67C0013X; label value OMSL02X H67C0014X; label value OMTC02X H67C0015X; label value OMTR02X H67C0016X; label value OMTYPE H67C0017X; label value OMTYPEX H67C0018X; label value OMVA02X H67C0019X; label value OMWC02X H67C0020X; label value OMXP02X H67C0021X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H67C, replace; #delimit cr * data file is stored in H67C.dta * log file is stored in H67C.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 H67C.LOG and a data file named H67C.DTA. If these files (H67C.DTA and H67C.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. ************************************************************************************************/