/***************** senicread97.sps ********************/ set width=80 length=none. title 'Senic data: Nosocomial infection study'. data list file='senic.dat' free / id stay age infrisk culratio xratio nbeds medschl region census nurses service. missing values stay,age culratio,xratio (9999) infrisk(999) nbeds to census, service (9) nurses (0,.999). variable labels 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 performed / # 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 facilities & services'. value labels medschl 1 'yes' 2 'no' / region 1 'northeast' 2 'north central' 3 'south' 4 'west' /. comment ***** recodes, computes & ifs ***** recode age (lowest thru 53=1)(53.1 thru highest=2) into agecat1. variable labels agecat1 'av patient age category'. value labels agecat1 1 '53 & under' 2 'over 53'/. recode age (lowest thru 53=1)(53.1 thru highest=2)(9999=9) into agecat2. missing values agecat2 (9). recode age (9999=9)(lowest thru 53=1)(53.1 thru highest=2) into agecat3. missing values agecat3 (9). recode age (lowest thru 53=1)(53.1 thru highest=2) (missing=sysmis) into agecat4. recode age (missing=sysmis)(lowest thru 53=1)(53.1 thru highest=2) into agecat5. comment compute ad hoc index of hospital quality compute quality=(2*service+nurses+nbeds+10*culratio +10*xratio-2*stay)/medschl. if (region eq 3) quality=quality-100. variable labels quality 'jerry''s bogus hospital quality index'. subtitle locate hospitals with av stay greater than 15 days if (stay gt 15) longstay=id.