/************************************************************************************************/ /* Stata User File for H36U23 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 */ /* (H36U23.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 H36U23.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\H36U23.DO */ /* The program below will output the Stata dataset H36U23.DTA */ /************************************************************************************************/ #delimit ; cd C:\MEPS\DATA; log using H36U23.log, replace; clear; * INPUT ALL VARIABLES; infix long DUID 1-7 int PID 8-10 str DUPERSID 11-20 byte PANEL 21-22 byte INH12 23-23 byte INH20 24-24 byte INH28 25-25 byte INH38 26-26 byte INH50 27-27 byte INH60 28-28 byte INH70 29-29 byte INH79 30-30 byte INH89 31-31 byte INH97 32-32 byte INH105 33-33 byte INH113 34-34 byte INH121 35-35 byte INH129 36-36 byte INH138 37-37 byte INH147 38-38 byte INH155 39-39 byte INH163 40-40 byte INH171 41-41 byte INH181 42-42 byte INH192 43-43 byte INH201 44-44 byte INH209 45-45 byte INH216 46-46 byte INH224 47-47 byte INH233 48-48 byte INH243 49-49 byte INH251 50-50 int STRA9623 51-54 byte PSU9623 55-55 using H36U23.dat; *DEFINE VARIABLE LABELS; label variable DUID "DWELLING UNIT ID"; label variable PID "PERSON NUMBER"; label variable DUPERSID "PERSON ID (DUID + PID)"; label variable PANEL "PANEL NUMBER"; label variable INH12 "IN H12 POPULATION (1996 FY)"; label variable INH20 "IN H20 POPULATION (1997 FY)"; label variable INH28 "IN H28 POPULATION (1998 FY)"; label variable INH38 "IN H38 POPULATION (1999 FY)"; label variable INH50 "IN H50 POPULATION (2000 FY)"; label variable INH60 "IN H60 POPULATION (2001 FY)"; label variable INH70 "IN H70 POPULATION (2002 FY)"; label variable INH79 "IN H79 POPULATION (2003 FY)"; label variable INH89 "IN H89 POPULATION (2004 FY)"; label variable INH97 "IN H97 POPULATION (2005 FY)"; label variable INH105 "IN H105 POPULATION (2006 FY)"; label variable INH113 "IN H113 POPULATION (2007 FY)"; label variable INH121 "IN H121 POPULATION (2008 FY)"; label variable INH129 "IN H129 POPULATION (2009 FY)"; label variable INH138 "IN H138 POPULATION (2010 FY)"; label variable INH147 "IN H147 POPULATION (2011 FY)"; label variable INH155 "IN H155 POPULATION (2012 FY)"; label variable INH163 "IN H163 POPULATION (2013 FY)"; label variable INH171 "IN H171 POPULATION (2014 FY)"; label variable INH181 "IN H181 POPULATION (2015 FY)"; label variable INH192 "IN H192 POPULATION (2016 FY)"; label variable INH201 "IN H201 POPULATION (2017 FY)"; label variable INH209 "IN H209 POPULATION (2018 FY)"; label variable INH216 "IN H216 POPULATION (2019 FY)"; label variable INH224 "IN H224 POPULATION (2020 FY)"; label variable INH233 "IN H233 POPULATION (2021 FY)"; label variable INH243 "IN H243 POPULATION (2022 FY)"; label variable INH251 "IN H251 POPULATION (2023 FY)"; label variable STRA9623 "COMBINED VARIANCE STRATUM: 1996-2023"; label variable PSU9623 "COMBINED VARIANCE PSU: 1996-2023"; *DEFINE VALUE LABELS FOR REPORTS; label define H36U230001X 1 "1 YES" 2 "2 NO" ; label define H36U230002X 1 "1 YES" 2 "2 NO" ; label define H36U230003X 1 "1 YES" 2 "2 NO" ; label define H36U230004X 1 "1 YES" 2 "2 NO" ; label define H36U230005X 1 "1 YES" 2 "2 NO" ; label define H36U230006X 1 "1 YES" 2 "2 NO" ; label define H36U230007X 1 "1 YES" 2 "2 NO" ; label define H36U230008X 1 "1 YES" 2 "2 NO" ; label define H36U230009X 1 "1 YES" 2 "2 NO" ; label define H36U230010X 1 "1 YES" 2 "2 NO" ; label define H36U230011X 1 "1 YES" 2 "2 NO" ; label define H36U230012X 1 "1 YES" 2 "2 NO" ; label define H36U230013X 1 "1 YES" 2 "2 NO" ; label define H36U230014X 1 "1 YES" 2 "2 NO" ; label define H36U230015X 1 "1 YES" 2 "2 NO" ; label define H36U230016X 1 "1 YES" 2 "2 NO" ; label define H36U230017X 1 "1 YES" 2 "2 NO" ; label define H36U230018X 1 "1 YES" 2 "2 NO" ; label define H36U230019X 1 "1 YES" 2 "2 NO" ; label define H36U230020X 1 "1 YES" 2 "2 NO" ; label define H36U230021X 1 "1 YES" 2 "2 NO" ; label define H36U230022X 1 "1 YES" 2 "2 NO" ; label define H36U230023X 1 "1 YES" 2 "2 NO" ; label define H36U230024X 1 "1 YES" 2 "2 NO" ; label define H36U230025X 1 "1 YES" 2 "2 NO" ; label define H36U230026X 1 "1 YES" 2 "2 NO" ; label define H36U230027X 1 "1 YES" 2 "2 NO" ; label define H36U230028X 1 "1 YES" 2 "2 NO" ; label define H36U230029X 1 "1 PANEL 1" 10 "10 PANEL 10" 11 "11 PANEL 11" 12 "12 PANEL 12" 13 "13 PANEL 13" 14 "14 PANEL 14" 15 "15 PANEL 15" 16 "16 PANEL 16" 17 "17 PANEL 17" 18 "18 PANEL 18" 19 "19 PANEL 19" 2 "2 PANEL 2" 20 "20 PANEL 20" 21 "21 PANEL 21" 22 "22 PANEL 22" 23 "23 PANEL 23" 24 "24 PANEL 24" 25 "25 PANEL 25" 26 "26 PANEL 26" 27 "27 PANEL 27" 28 "28 PANEL 28" 3 "3 PANEL 3" 4 "4 PANEL 4" 5 "5 PANEL 5" 6 "6 PANEL 6" 7 "7 PANEL 7" 8 "8 PANEL 8" 9 "9 PANEL 9" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label value INH105 H36U230001X; label value INH113 H36U230002X; label value INH12 H36U230003X; label value INH121 H36U230004X; label value INH129 H36U230005X; label value INH138 H36U230006X; label value INH147 H36U230007X; label value INH155 H36U230008X; label value INH163 H36U230009X; label value INH171 H36U230010X; label value INH181 H36U230011X; label value INH192 H36U230012X; label value INH20 H36U230013X; label value INH201 H36U230014X; label value INH209 H36U230015X; label value INH216 H36U230016X; label value INH224 H36U230017X; label value INH233 H36U230018X; label value INH243 H36U230019X; label value INH251 H36U230020X; label value INH28 H36U230021X; label value INH38 H36U230022X; label value INH50 H36U230023X; label value INH60 H36U230024X; label value INH70 H36U230025X; label value INH79 H36U230026X; label value INH89 H36U230027X; label value INH97 H36U230028X; label value PANEL H36U230029X; *DISPLAY A DESCRIPTION OF STATA FILE; describe; *LIST FIRST 20 OBSERVATIONS IN THE FILE; list in 1/20; save H36U23, replace; #delimit cr * data file is stored in H36U23.dta * log file is stored in H36U23.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 H36U23.LOG and a data file named H36U23.DTA. If these files (H36U23.DTA and H36U23.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. ************************************************************************************************/