/******* senicread.sas ************************************** * Just reads and labels SENIC data * * Use with %include '/folders/myfolders/2453f15/senicread.sas'; * ************************************************************/ title 'Study of the Effectiveness of Nosocomial Infection Control'; proc format; /* value labels used in data step below */ value regfmt 1 = 'Northeast' 2 = 'North Central' 3 = 'South' 4 = 'West' ; value acatfmt 1 = '53 & under' 2 = 'Over 53'; data senic; missing X R; /* These are now missing values for any numeric variable. */ infile '/folders/myfolders/2453f15/senicdata.txt'; input id stay age infrisk culratio xratio nbeds medschl $ region census nurses service; if medschl = '?' then medschl = ' ' ; /* Blank=missing for character vars */ label id = 'Hospital identification number' stay = 'Av length of hospital stay, in days' age = 'Average patient age' infrisk = 'Prob of acquiring infection in hospital' culratio = '# cultures / # no hosp acq infect' xratio = '# x-rays / # no signs of pneumonia' nbeds = 'Average # beds during study period' medschl = 'Medical school affiliation' region = 'Region of country (usa)' census = 'Aver # patients in hospital per day' nurses = 'Aver # nurses during study period' service = '% of 35 potential facil. & services' ; /* Associating variables with their printing formats */ format region regfmt.; /***** recodes, computes & ifs *****/ if 053 then agecat=2; label agecat = 'av patient age category'; format agecat acatfmt.; /* compute ad hoc index of hospital quality */ quality=(2*service+nurses+nbeds+10*culratio +10*xratio-2*stay); if medschl = 'N' then quality = quality/2; if (region eq 3) then quality=quality-100; label quality = "Jerry's bogus hospital quality index";