Hi
I'm not even sure if this is the right group or even a SAS procedure so I apologize if I'm wrong on either account. I am using SAS 9.3.
I have a table of hospital data that includes admit date, discharge date and total length of stay in days. I've been asked to identify number of patients per day or week for a specific doctor service group (family practice). So if a patient was in hospital from April 1 to April 5, 2012 and I'm showing per day, then this patient would be counted on Sunday, Monday, Tuesday, Wednesday and Thursday. Any thoughts on how to do this for the entire database?
Thanks.
It's an occupancy rate calculations, similar to counting a hotel night.
One way is to expand your data set so you have a record for every day and then run a proc freq by date and facility. But it is data intensive, the data set can get very big, very fast.
data want;
set have;
do date=admit_date to discharge_date;
output;
end;
run;
proc freq data=want;
table have;
run;
Hi.
Can you post some sample data to understand how your data looks like?
It's an occupancy rate calculations, similar to counting a hotel night.
One way is to expand your data set so you have a record for every day and then run a proc freq by date and facility. But it is data intensive, the data set can get very big, very fast.
data want;
set have;
do date=admit_date to discharge_date;
output;
end;
run;
proc freq data=want;
table have;
run;
Hi
Thanks so much, Reeza, that worked as I wanted it to. Another question for you: right now I'm able to indicate number of patients per day what if I want average number of patients per day, do I divide each day volumes by 52 (if for the full year)?
Thanks.
If you want the average number of patients per day run a proc means on the output from proc freq, to get the average number per day.
You can always manually add it up and divide but I prefer using procedures.
Thanks Reeza!!!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.