/************************************************************************************************/ /* Stata User File for H206C 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 */ /* (H206C.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 H206C.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\H206C.DO */ /* The program below will output the Stata dataset H206C.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H206C.log, replace; clear; * INPUT ALL VARIABLES; infix long DUID 1-7 int PID 8-10 str DUPERSID 11-20 str EVNTIDX 21-36 byte EVENTRN 37-37 byte PANEL 38-39 byte OMTYPE_M18 40-40 double OMSF18X 41-47 double OMMR18X 48-55 double OMMD18X 56-63 double OMPV18X 64-71 double OMVA18X 72-78 double OMTR18X 79-86 double OMOF18X 87-94 double OMSL18X 95-101 double OMWC18X 102-109 double OMOR18X 110-116 double OMOU18X 117-123 double OMOT18X 124-130 double OMXP18X 131-138 double OMTC18X 139-146 byte IMPFLAG 147-147 double PERWT18F 148-159 int VARSTR 160-163 byte VARPSU 164-164 using H206C.dat; *DEFINE VARIABLE LABELS; label variable DUID "PANEL # + ENCRYPTED DU IDENTIFIER"; 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 PANEL "PANEL NUMBER"; label variable OMTYPE_M18 "OTHER MEDICAL EXPENSE TYPE"; label variable OMSF18X "AMOUNT PAID, FAMILY (IMPUTED)"; label variable OMMR18X "AMOUNT PAID, MEDICARE (IMPUTED)"; label variable OMMD18X "AMOUNT PAID, MEDICAID (IMPUTED)"; label variable OMPV18X "AMOUNT PAID, PRIVATE INSURANCE (IMPUTED)"; label variable OMVA18X "AMOUNT PAID, VETERANS/CHAMPVA(IMPUTED)"; label variable OMTR18X "AMOUNT PAID, TRICARE(IMPUTED)"; label variable OMOF18X "AMOUNT PAID, OTHER FEDERAL (IMPUTED)"; label variable OMSL18X "AMOUNT PAID, STATE & LOCAL GOV (IMPUTED)"; label variable OMWC18X "AMOUNT PAID, WORKERS COMP (IMPUTED)"; label variable OMOR18X "AMOUNT PAID, OTHER PRIVATE (IMPUTED)"; label variable OMOU18X "AMOUNT PAID, OTHER PUBLIC (IMPUTED)"; label variable OMOT18X "AMOUNT PAID, OTHER INSURANCE (IMPUTED)"; label variable OMXP18X "SUM OF OMSF18X-OMOT18X (IMPUTED)"; label variable OMTC18X "HHLD REPORTED TOTAL CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT18F "EXPENDITURE FILE PERSON WEIGHT, 2018"; label variable VARSTR "VARIANCE ESTIMATION STRATUM, 2018"; label variable VARPSU "VARIANCE ESTIMATION PSU, 2018"; *DEFINE VALUE LABELS FOR REPORTS; label define H206C0001X 1 "ROUND 1" 2 "ROUND 2" 3 "ROUND 3" 4 "ROUND 4" 5 "ROUND 5" ; label define H206C0002X -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 H206C0003X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0004X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0005X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0006X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0007X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0008X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0009X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0010X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0011X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0012X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0013X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0014X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" 1 "1 GLASSES OR CONTACT LENSES" 2 "2 AMBULANCE SERVICES" 3 "3 DISPOSABLE SUPPLIES" 4 "4 LONG TERM MEDICAL EQUIPMENT" ; label define H206C0015X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0016X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0017X -1 "-1 INAPPLICABLE" 0 "0" ; label define H206C0018X 22 "PANEL 22" 23 "PANEL 23" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value EVENTRN H206C0001X; label value IMPFLAG H206C0002X; label value OMMD18X H206C0003X; label value OMMR18X H206C0004X; label value OMOF18X H206C0005X; label value OMOR18X H206C0006X; label value OMOT18X H206C0007X; label value OMOU18X H206C0008X; label value OMPV18X H206C0009X; label value OMSF18X H206C0010X; label value OMSL18X H206C0011X; label value OMTC18X H206C0012X; label value OMTR18X H206C0013X; label value OMTYPE_M18 H206C0014X; label value OMVA18X H206C0015X; label value OMWC18X H206C0016X; label value OMXP18X H206C0017X; label value PANEL H206C0018X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H206C, replace; #delimit cr * data file is stored in H206C.dta * log file is stored in H206C.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 H206C.LOG and a data file named H206C.DTA. If these files (H206C.DTA and H206C.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. ************************************************************************************************/