1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 /********************* senic1.sas ***************************/
70 title 'Open SENIC Data';
71 title2 'Basic Descriptive Statistics';
72
73 proc format;
73 ! /* Value labels used in data step below */
74 value yesnofmt 1 = 'Yes' 0 = 'No' ;
NOTE: Format YESNOFMT is already on the library WORK.FORMATS.
NOTE: Format YESNOFMT has been output.
75 value regfmt 1 = 'Northeast'
76 2 = 'North Central'
77 3 = 'South'
78 4 = 'West' ;
NOTE: Format REGFMT is already on the library WORK.FORMATS.
NOTE: Format REGFMT has been output.
79
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 248.00k
OS Memory 21152.00k
Timestamp 12/21/2023 05:08:04 PM
Step Count 59 Switch Count 0
Page Faults 0
Page Reclaims 19
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 32
80 data senic;
81 infile '/home/u1407221/441s24/SAS02/openSENIC2.data.txt' firstobs=2;
82 /* Skip the first line that R uses */
83 input id region mdschl $ census nbeds nurses lngstay age
84 xratio culratio infpercent;
85
86 /* Fix up problems */
87 if mdschl = '?' then mdschl = ' '; /* Blank = missing for character vars */
88 if age = 999 then age = .;
89 if infpercent = 999 then infpercent = .;
90
91 /***** Recodes, computes & ifs *****/
92 if 0<age<=53 then agecat = '53 & under';
93 else if age>53 then agecat='Over 53';
94 label agecat = 'Average patient age';
95 quality=(2*nurses+nbeds+10*culratio
96 +10*xratio-2*lngstay);
97 if mdschl eq 'No' then quality=quality/2;
98 if (region eq 3) then quality=quality-100;
99 label quality = 'Jerry''s bogus hospital quality index';
100
NOTE: The infile '/home/u1407221/441s24/SAS02/openSENIC2.data.txt' is:
Filename=/home/u1407221/441s24/SAS02/openSENIC2.data.txt,
Owner Name=u1407221,Group Name=oda,
Access Permission=-rw-r--r--,
Last Modified=21Dec2023:11:37:19,
File Size (bytes)=8585
NOTE: 100 records were read from the infile '/home/u1407221/441s24/SAS02/openSENIC2.data.txt'.
The minimum record length was 83.
The maximum record length was 83.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
3 at 95:16 3 at 97:44 2 at 98:43
NOTE: The data set WORK.SENIC has 100 observations and 13 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 781.37k
OS Memory 21668.00k
Timestamp 12/21/2023 05:08:04 PM
Step Count 60 Switch Count 2
Page Faults 0
Page Reclaims 137
Page Swaps 0
Voluntary Context Switches 20
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 272
101 proc freq;
102 title3 'Frequency distributions of categorical variables';
103 tables region mdschl agecat;
104
NOTE: There were 100 observations read from the data set WORK.SENIC.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 1789.00k
OS Memory 22184.00k
Timestamp 12/21/2023 05:08:04 PM
Step Count 61 Switch Count 3
Page Faults 0
Page Reclaims 245
Page Swaps 0
Voluntary Context Switches 19
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 272
105 proc means;
106 title3 'Table of means and standard deviations';
107 var census nbeds nurses lngstay age xratio culratio infpercent
108 quality;
109
110 /* How did SAS handle the missing value for age? */
111
NOTE: There were 100 observations read from the data set WORK.SENIC.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.03 seconds
user cpu time 0.03 seconds
system cpu time 0.01 seconds
memory 6473.75k
OS Memory 27576.00k
Timestamp 12/21/2023 05:08:04 PM
Step Count 62 Switch Count 2
Page Faults 0
Page Reclaims 1454
Page Swaps 0
Voluntary Context Switches 26
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
112 proc freq;
113 title3 'Check missing value for age';
114 tables age * agecat / norow nocol nopercent missing;
115
116 run;
NOTE: There were 100 observations read from the data set WORK.SENIC.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.14 seconds
user cpu time 0.15 seconds
system cpu time 0.00 seconds
memory 1238.31k
OS Memory 22956.00k
Timestamp 12/21/2023 05:08:04 PM
Step Count 63 Switch Count 5
Page Faults 0
Page Reclaims 227
Page Swaps 0
Voluntary Context Switches 35
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 600
117
118 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
128