/************************************************************************************************/ /* Stata User File for H239C 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 */ /* (H239C.DAT) supplied in this PUF release. */ /* 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 H239C.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\H239C.DO */ /* The program below will output the Stata dataset H239C.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H239C.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 OMSF22X 41-48 double OMMR22X 49-56 double OMMD22X 57-64 double OMPV22X 65-72 double OMVA22X 73-79 double OMTR22X 80-87 double OMOF22X 88-94 double OMSL22X 95-101 double OMWC22X 102-109 double OMOT22X 110-117 double OMXP22X 118-125 double OMTC22X 126-134 byte IMPFLAG 135-135 double PERWT22F 136-148 int VARSTR 149-152 byte VARPSU 153-153 using H239C.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 OMSF22X "AMOUNT PAID, FAMILY (IMPUTED)"; label variable OMMR22X "AMOUNT PAID, MEDICARE (IMPUTED)"; label variable OMMD22X "AMOUNT PAID, MEDICAID (IMPUTED)"; label variable OMPV22X "AMOUNT PAID, PRIVATE INSURANCE (IMPUTED)"; label variable OMVA22X "AMOUNT PAID, VETERANS/CHAMPVA (IMPUTED)"; label variable OMTR22X "AMOUNT PAID, TRICARE (IMPUTED)"; label variable OMOF22X "AMOUNT PAID, OTHER FEDERAL (IMPUTED)"; label variable OMSL22X "AMOUNT PAID, STATE & LOCAL GOV (IMPUTED)"; label variable OMWC22X "AMOUNT PAID, WORKERS COMP (IMPUTED)"; label variable OMOT22X "AMOUNT PAID, OTHER INSURANCE (IMPUTED)"; label variable OMXP22X "SUM OF OMSF22X - OMOT22X (IMPUTED)"; label variable OMTC22X "HHLD REPORTED TOTAL CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT22F "EXPENDITURE FILE PERSON WEIGHT, 2022"; label variable VARSTR "VARIANCE ESTIMATION STRATUM, 2022"; label variable VARPSU "VARIANCE ESTIMATION PSU, 2022"; *DEFINE VALUE LABELS FOR REPORTS; label define H239C0001X 1 "1 ROUND 1" 2 "2 ROUND 2" 3 "3 ROUND 3" 4 "4 ROUND 4" 5 "5 ROUND 5" 6 "6 ROUND 6" 7 "7 ROUND 7" 8 "8 ROUND 8" 9 "9 ROUND 9" ; label define H239C0002X 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 H239C0003X -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 H239C0004X 24 "24 PANEL 24" 26 "26 PANEL 26" 27 "27 PANEL 27" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value EVENTRN H239C0001X; label value IMPFLAG H239C0002X; label value OMTYPE_M18 H239C0003X; label value PANEL H239C0004X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H239C, replace; #delimit cr * data file is stored in H239C.dta * log file is stored in H239C.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 H239C.LOG and a data file named H239C.DTA. If these files (H239C.DTA and H239C.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. ************************************************************************************************/