/************************************************************************************************/ /* Stata User File for H51C 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 */ /* (H51C.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 H51C.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\H51C.DO */ /* The program below will output the Stata dataset H51C.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H51C.log, replace; clear; * INPUT ALL VARIABLES; infix long DUID 1-5 byte PID 6-7 str DUPERSID 8-15 str EVNTIDX 16-27 byte EVENTRN 28-28 str FFEEIDX 29-40 byte OMTYPEX 41-42 byte OMTYPE 43-44 str OMOTHOX 45-69 str OMOTHOS 70-94 byte FFOMTYPE 95-96 byte FFBEF00 97-98 double OMSF00X 99-106 double OMMR00X 107-113 double OMMD00X 114-120 double OMPV00X 121-127 double OMVA00X 128-134 double OMTR00X 135-141 double OMOF00X 142-147 double OMSL00X 148-153 double OMWC00X 154-159 double OMOR00X 160-165 double OMOU00X 166-171 double OMOT00X 172-177 double OMXP00X 178-185 double OMTC00X 186-193 byte IMPFLAG 194-194 double PERWT00F 195-206 byte VARSTR00 207-208 byte VARPSU00 209-210 using H51C.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 FFBEF00 "TOTAL # OF VISITS IN FF BEFORE 2000"; label variable OMSF00X "AMOUNT PAID, FAMILY (IMPUTED)"; label variable OMMR00X "AMOUNT PAID, MEDICARE (IMPUTED)"; label variable OMMD00X "AMOUNT PAID, MEDICAID (IMPUTED)"; label variable OMPV00X "AMOUNT PAID, PRIVATE INSURANCE (IMPUTED)"; label variable OMVA00X "AMOUNT PAID, VETERANS (IMPUTED)"; label variable OMTR00X "AMOUNT PAID, TRICARE (IMPUTED)"; label variable OMOF00X "AMOUNT PAID, OTHER FEDERAL (IMPUTED)"; label variable OMSL00X "AMOUNT PAID, STATE & LOCAL GOV (IMPUTED)"; label variable OMWC00X "AMOUNT PAID, WORKERS COMP (IMPUTED)"; label variable OMOR00X "AMOUNT PAID, OTHER PRIVATE (IMPUTED)"; label variable OMOU00X "AMOUNT PAID, OTHER PUBLIC (IMPUTED)"; label variable OMOT00X "AMOUNT PAID, OTHER INSURANCE (IMPUTED)"; label variable OMXP00X "SUM OF OMSF00X-OMOT00X (IMPUTED)"; label variable OMTC00X "HHLD REPORTED TOTAL CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT00F "FINAL PERSON LEVEL WEIGHT, 2000"; label variable VARSTR00 "VARIANCE ESTIMATION STRATUM, 2000"; label variable VARPSU00 "VARIANCE ESTIMATION PSU, 2000"; *DEFINE VALUE LABELS FOR REPORTS; label define H51C0001X 1 "ROUND 1" 2 "ROUND 2" 3 "ROUND 3" 4 "ROUND 4" 5 "ROUND 5" ; label define H51C0002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" 1 "1" ; label define H51C0003X -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 H51C0004X -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 H51C0005X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0006X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0007X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0008X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0009X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0010X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0011X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0012X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0013X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0014X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0015X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0016X -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 H51C0017X -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 H51C0018X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0019X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H51C0020X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value EVENTRN H51C0001X; label value FFBEF00 H51C0002X; label value FFOMTYPE H51C0003X; label value IMPFLAG H51C0004X; label value OMMD00X H51C0005X; label value OMMR00X H51C0006X; label value OMOF00X H51C0007X; label value OMOR00X H51C0008X; label value OMOT00X H51C0009X; label value OMOU00X H51C0010X; label value OMPV00X H51C0011X; label value OMSF00X H51C0012X; label value OMSL00X H51C0013X; label value OMTC00X H51C0014X; label value OMTR00X H51C0015X; label value OMTYPE H51C0016X; label value OMTYPEX H51C0017X; label value OMVA00X H51C0018X; label value OMWC00X H51C0019X; label value OMXP00X H51C0020X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H51C, replace; #delimit cr * data file is stored in H51C.dta * log file is stored in H51C.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 H51C.LOG and a data file named H51C.DTA. If these files (H51C.DTA and H51C.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. ************************************************************************************************/