/************************************************************************************************/ /* Stata User File for H168C 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 */ /* (H168C.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 H168C.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\H168C.DO */ /* The program below will output the Stata dataset H168C.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H168C.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 PANEL 42-43 byte OMTYPEX 44-45 byte OMTYPE 46-47 str OMOTHOX 48-72 str OMOTHOS 73-97 byte FFOMTYPE 98-99 byte FFBEF14 100-101 byte FFTOT15 102-103 double OMSF14X 104-111 double OMMR14X 112-119 double OMMD14X 120-127 double OMPV14X 128-135 double OMVA14X 136-142 double OMTR14X 143-149 double OMOF14X 150-156 double OMSL14X 157-164 double OMWC14X 165-170 double OMOR14X 171-177 double OMOU14X 178-184 double OMOT14X 185-191 double OMXP14X 192-199 double OMTC14X 200-208 byte IMPFLAG 209-209 double PERWT14F 210-221 int VARSTR 222-225 byte VARPSU 226-226 using H168C.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 PANEL "PANEL NUMBER"; 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 FFBEF14 "TOTAL # OF VISITS IN FF BEFORE 2014"; label variable FFTOT15 "TOTAL # OF VISITS IN FF AFTER 2014"; label variable OMSF14X "AMOUNT PAID, FAMILY (IMPUTED)"; label variable OMMR14X "AMOUNT PAID, MEDICARE (IMPUTED)"; label variable OMMD14X "AMOUNT PAID, MEDICAID (IMPUTED)"; label variable OMPV14X "AMOUNT PAID, PRIVATE INSURANCE (IMPUTED)"; label variable OMVA14X "AMOUNT PAID, VETERANS/CHAMPVA(IMPUTED)"; label variable OMTR14X "AMOUNT PAID, TRICARE(IMPUTED)"; label variable OMOF14X "AMOUNT PAID, OTHER FEDERAL (IMPUTED)"; label variable OMSL14X "AMOUNT PAID, STATE & LOCAL GOV (IMPUTED)"; label variable OMWC14X "AMOUNT PAID, WORKERS COMP (IMPUTED)"; label variable OMOR14X "AMOUNT PAID, OTHER PRIVATE (IMPUTED)"; label variable OMOU14X "AMOUNT PAID, OTHER PUBLIC (IMPUTED)"; label variable OMOT14X "AMOUNT PAID, OTHER INSURANCE (IMPUTED)"; label variable OMXP14X "SUM OF OMSF14X-OMOT14X (IMPUTED)"; label variable OMTC14X "HHLD REPORTED TOTAL CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT14F "EXPENDITURE FILE PERSON WEIGHT, 2014"; label variable VARSTR "VARIANCE ESTIMATION STRATUM, 2014"; label variable VARPSU "VARIANCE ESTIMATION PSU, 2014"; *DEFINE VALUE LABELS FOR REPORTS; label define H168C0001X 1 "ROUND 1" 2 "ROUND 2" 3 "ROUND 3" 4 "ROUND 4" 5 "ROUND 5" ; label define H168C0002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0003X -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 H168C0004X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" 1 "1" ; label define H168C0005X -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 H168C0006X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0007X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0008X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0009X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0010X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0011X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0012X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0013X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0014X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0015X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0016X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0017X -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" 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 H168C0018X -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" 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 H168C0019X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0020X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0021X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H168C0022X 18 "PANEL 18" 19 "PANEL 19" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value EVENTRN H168C0001X; label value FFBEF14 H168C0002X; label value FFOMTYPE H168C0003X; label value FFTOT15 H168C0004X; label value IMPFLAG H168C0005X; label value OMMD14X H168C0006X; label value OMMR14X H168C0007X; label value OMOF14X H168C0008X; label value OMOR14X H168C0009X; label value OMOT14X H168C0010X; label value OMOU14X H168C0011X; label value OMPV14X H168C0012X; label value OMSF14X H168C0013X; label value OMSL14X H168C0014X; label value OMTC14X H168C0015X; label value OMTR14X H168C0016X; label value OMTYPE H168C0017X; label value OMTYPEX H168C0018X; label value OMVA14X H168C0019X; label value OMWC14X H168C0020X; label value OMXP14X H168C0021X; label value PANEL H168C0022X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H168C, replace; #delimit cr * data file is stored in H168C.dta * log file is stored in H168C.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 H168C.LOG and a data file named H168C.DTA. If these files (H168C.DTA and H168C.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. ************************************************************************************************/