/***************************************************************************** * Stataload_KID_2016_Hospital.Do * This program will load the KID_2016_Hospital ASCII 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 long HOSP_KID 1- 5 /// byte HOSP_BEDSIZE 6- 7 /// byte HOSP_LOCTEACH 8- 9 /// byte HOSP_REGION 10- 11 /// byte H_CONTRL 12- 13 /// int KID_STRATUM 14- 17 /// long N_BRTH_U 18- 25 /// long N_DISC_U 26- 33 /// int N_HOSP_U 34- 37 /// long S_BRTH_U 38- 45 /// long S_CHLD_U 46- 53 /// long S_CMPB_U 54- 61 /// long S_DISC_U 62- 69 /// int S_HOSP_U 70- 73 /// long S_UNCB_U 74- 81 /// int YEAR 82- 85 /// using "KID_2016_Hospital.ASC" *** Assign labels to the data elements *** label var HOSP_KID "KID hospital number" label var HOSP_BEDSIZE "Bedsize of hospital" label var HOSP_LOCTEACH "Location/teaching status of hospital" label var HOSP_REGION "Region of hospital" label var H_CONTRL "Control/ownership of hospital" label var KID_STRATUM "KID hospital stratum" label var N_BRTH_U "Number of universe births in the stratum" label var N_DISC_U "Number of universe discharges in the stratum" label var N_HOSP_U "Number of universe hospitals in the stratum" label var S_BRTH_U "Number of sample births in the stratum" label var S_CHLD_U "Number of sample pediatric non-births in the stratum" label var S_CMPB_U "Number of sample complicated births in the stratum" label var S_DISC_U "Number of sample births and children in the stratum" label var S_HOSP_U "Number of sample hospitals in the stratum" label var S_UNCB_U "Number of sample uncomplicated births in the stratum" label var YEAR "Calendar year" *** Convert special values to missing values *** recode HOSP_KID (-9999 -8888 -6666=.) recode HOSP_BEDSIZE (-9 -8 -6 -5=.) recode HOSP_LOCTEACH (-9 -8 -6 -5=.) recode HOSP_REGION (-9 -8 -6 -5=.) recode H_CONTRL (-9 -8 -6 -5=.) recode KID_STRATUM (-999 -888 -666=.) recode N_BRTH_U (-9999999 -8888888 -6666666=.) recode N_DISC_U (-9999999 -8888888 -6666666=.) recode N_HOSP_U (-999 -888 -666=.) recode S_BRTH_U (-9999999 -8888888 -6666666=.) recode S_CHLD_U (-9999999 -8888888 -6666666=.) recode S_CMPB_U (-9999999 -8888888 -6666666=.) recode S_DISC_U (-9999999 -8888888 -6666666=.) recode S_HOSP_U (-999 -888 -666=.) recode S_UNCB_U (-9999999 -8888888 -6666666=.) recode YEAR (-999 -888 -666=.) save "KID_2016_Hospital.dta", replace