/************************************************************************************************/ /* Stata User File for H197C 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 */ /* (H197C.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 H197C.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\H197C.DO */ /* The program below will output the Stata dataset H197C.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H197C.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 FFOMTYPE 46-47 byte FFBEF17 48-49 double OMSF17X 50-57 double OMMR17X 58-65 double OMMD17X 66-73 double OMPV17X 74-81 double OMVA17X 82-88 double OMTR17X 89-95 double OMOF17X 96-101 double OMSL17X 102-107 double OMWC17X 108-114 double OMOR17X 115-121 double OMOU17X 122-128 double OMOT17X 129-135 double OMXP17X 136-143 double OMTC17X 144-152 byte IMPFLAG 153-153 double PERWT17F 154-165 int VARSTR 166-169 byte VARPSU 170-170 using H197C.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 FFOMTYPE "FLAT FEE BUNDLE"; label variable FFBEF17 "TOTAL # OF VISITS IN FF BEFORE 2017"; label variable OMSF17X "AMOUNT PAID, FAMILY (IMPUTED)"; label variable OMMR17X "AMOUNT PAID, MEDICARE (IMPUTED)"; label variable OMMD17X "AMOUNT PAID, MEDICAID (IMPUTED)"; label variable OMPV17X "AMOUNT PAID, PRIVATE INSURANCE (IMPUTED)"; label variable OMVA17X "AMOUNT PAID, VETERANS/CHAMPVA(IMPUTED)"; label variable OMTR17X "AMOUNT PAID, TRICARE(IMPUTED)"; label variable OMOF17X "AMOUNT PAID, OTHER FEDERAL (IMPUTED)"; label variable OMSL17X "AMOUNT PAID, STATE & LOCAL GOV (IMPUTED)"; label variable OMWC17X "AMOUNT PAID, WORKERS COMP (IMPUTED)"; label variable OMOR17X "AMOUNT PAID, OTHER PRIVATE (IMPUTED)"; label variable OMOU17X "AMOUNT PAID, OTHER PUBLIC (IMPUTED)"; label variable OMOT17X "AMOUNT PAID, OTHER INSURANCE (IMPUTED)"; label variable OMXP17X "SUM OF OMSF17X-OMOT17X (IMPUTED)"; label variable OMTC17X "HHLD REPORTED TOTAL CHARGE (IMPUTED)"; label variable IMPFLAG "IMPUTATION STATUS"; label variable PERWT17F "EXPENDITURE FILE PERSON WEIGHT, 2017"; label variable VARSTR "VARIANCE ESTIMATION STRATUM, 2017"; label variable VARPSU "VARIANCE ESTIMATION PSU, 2017"; *DEFINE VALUE LABELS FOR REPORTS; label define H197C0001X 1 "ROUND 1" 2 "ROUND 2" 3 "ROUND 3" 4 "ROUND 4" 5 "ROUND 5" ; label define H197C0002X -1 "-1 INAPPLICABLE" -7 "-7 REFUSED" -8 "-8 DK" -9 "-9 NOT ASCERTAINED" 0 "0" 1 "1" ; label define H197C0003X -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 H197C0004X -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 H197C0005X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0006X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0007X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0008X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0009X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0010X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0011X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0012X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0013X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0014X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0015X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0016X 1 "1 GLASSES OR CONTACT LENSES" 10 "10 DISPOSABLE SUPPLIES" 12 "12 LONG TERM MEDICAL EQUIPMENT" 4 "4 AMBULANCE SERVICES" ; label define H197C0017X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0018X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0019X -1 "-1 INAPPLICABLE" -9 "-9 NOT ASCERTAINED" 0 "0" ; label define H197C0020X 21 "PANEL 21" 22 "PANEL 22" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value EVENTRN H197C0001X; label value FFBEF17 H197C0002X; label value FFOMTYPE H197C0003X; label value IMPFLAG H197C0004X; label value OMMD17X H197C0005X; label value OMMR17X H197C0006X; label value OMOF17X H197C0007X; label value OMOR17X H197C0008X; label value OMOT17X H197C0009X; label value OMOU17X H197C0010X; label value OMPV17X H197C0011X; label value OMSF17X H197C0012X; label value OMSL17X H197C0013X; label value OMTC17X H197C0014X; label value OMTR17X H197C0015X; label value OMTYPEX H197C0016X; label value OMVA17X H197C0017X; label value OMWC17X H197C0018X; label value OMXP17X H197C0019X; label value PANEL H197C0020X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H197C, replace; #delimit cr * data file is stored in H197C.dta * log file is stored in H197C.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 H197C.LOG and a data file named H197C.DTA. If these files (H197C.DTA and H197C.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. ************************************************************************************************/