BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
shellp55
Quartz | Level 8

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

View solution in original post

5 REPLIES 5
bnarang
Calcite | Level 5

Hi.

Can you post some sample data to understand how your data looks like?

Reeza
Super User

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;

shellp55
Quartz | Level 8

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.

Reeza
Super User

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.

shellp55
Quartz | Level 8

Thanks Reeza!!!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2296 views
  • 3 likes
  • 3 in conversation