/***************************************************************************** * Stataload_NIS_2005_Hospital.Do * This program will load the 2005 NIS ASCII Hospital File into Stata. * Because Stata loads the entire file into memory, it may not be possible * to load every data element for large files. If necessary, edit this * program to change the memory size or to load only selected data elements. *****************************************************************************/ *** Set available memory size *** set mem 500m *** Read data elements from the ASCII file *** infix str AHAID 1- 7 /// double DISCWT 8- 18 /// long HFIPSSTCO 19- 23 /// str HOSPADDR 24- 53 /// str HOSPCITY 54- 73 /// long HOSPID 74- 78 /// str HOSPNAME 79-108 /// str HOSPST 109-110 /// long HOSPSTCO 111-115 /// double HOSPWT 116-126 /// str HOSPZIP 127-131 /// byte HOSP_BEDSIZE 132-133 /// byte HOSP_CONTROL 134-135 /// byte HOSP_LOCATION 136-137 /// byte HOSP_LOCTEACH 138-139 /// byte HOSP_REGION 140-141 /// byte HOSP_TEACH 142-143 /// str IDNUMBER 144-149 /// int NIS_STRATUM 150-153 /// long N_DISC_U 154-161 /// int N_HOSP_U 162-165 /// long S_DISC_U 166-171 /// int S_HOSP_U 172-175 /// long TOTAL_DISC 176-181 /// int YEAR 182-185 /// using "NIS_2005_Hospital.ASC" *** Assign labels to the data elements *** label var AHAID "AHA hospital identifier with the leading 6" label var DISCWT "Weight to discharges in AHA universe" label var HFIPSSTCO "Hospital FIPS state/county code" label var HOSPADDR "Hospital address from AHA Survey (Z011)" label var HOSPCITY "Hospital city from AHA Survey (Z012)" label var HOSPID "HCUP hospital identification number" label var HOSPNAME "Hospital name from AHA Survey (Z000)" label var HOSPST "Hospital state postal code" label var HOSPSTCO "Hospital modified FIPS state/county code" label var HOSPWT "Weight to hospitals in AHA universe" label var HOSPZIP "Hospital ZIP Code from AHA Survey (Z014)" label var HOSP_BEDSIZE "Bed size of hospital" label var HOSP_CONTROL "Control/ownership of hospital" label var HOSP_LOCATION "Location (urban/rural) of hospital" label var HOSP_LOCTEACH "Location/teaching status of hospital" label var HOSP_REGION "Region of hospital" label var HOSP_TEACH "Teaching status of hospital" label var IDNUMBER "AHA hospital identifier without the leading 6" label var NIS_STRATUM "Stratum used to sample hospital" label var N_DISC_U "Number of AHA universe discharges in NIS_STRATUM" label var N_HOSP_U "Number of AHA universe hospitals in NIS_STRATUM" label var S_DISC_U "Number of sample discharges in NIS_STRATUM" label var S_HOSP_U "Number of sample hospitals in NIS_STRATUM" label var TOTAL_DISC "Total number of discharges from this hospital in the NIS" label var YEAR "Calendar Year" *** Convert special values to missing values *** recode DISCWT (-99.9999999 -88.8888888 -66.6666666=.) recode HFIPSSTCO (-9999 -8888 -6666=.) recode HOSPSTCO (-9999 -8888 -6666=.) recode HOSPWT (-99.9999999 -88.8888888 -66.6666666=.) recode HOSP_BEDSIZE (-9 -8 -6 -5=.) recode HOSP_CONTROL (-9 -8 -6 -5=.) recode HOSP_LOCATION (-9 -8 -6 -5=.) recode HOSP_LOCTEACH (-9 -8 -6 -5=.) recode HOSP_REGION (-9 -8 -6 -5=.) recode HOSP_TEACH (-9 -8 -6 -5=.) recode NIS_STRATUM (-999 -888 -666=.) recode N_DISC_U (-9999999 -8888888 -6666666=.) recode N_HOSP_U (-999 -888 -666=.) recode S_DISC_U (-99999 -88888 -66666=.) recode S_HOSP_U (-999 -888 -666=.) recode TOTAL_DISC (-99999 -88888 -66666=.) recode YEAR (-999 -888 -666=.) save "NIS_2005_Hospital.dta", replace