```Date: Wed, 28 Oct 2009 19:32:56 -0500 Reply-To: Lou Sender: "SAS(r) Discussion" From: Lou Organization: A noiseless patient Spider Subject: Re: calculating number of people present given their arrival and departure time Comments: To: sas-l@uga.edu "bigD" wrote in message news:08fa14e0-5632-4600-a970-2b9df177d5d6@j9g2000vbp.googlegroups.com... > Hi, > > I have a data set that contains the time a person entered the > emergency room and the time they left. > I would like to know how many people were in the emergency department > for each hour of the day on a weekly basis. The problem statement could be a little stronger. For instance, just for purposes of illustration, let's suppose a day is two hours long - 120 minutes. How many hourly intervals are you concerned with? Two, starting from time 0 and ending at time 120? Or maybe it's 60, the first interval starting at time 0 and ending at time 60, the second starting at time 1 and ending at time 61, etc.? Or maybe it's only 1, starting at time 30 and ending at time 90?. I ask because recently I had to calculate the average number of episodes a patient had per 28 days over a 84 day interval, and there are 56 periods of 28 days in an 84 day interval. Whatever the answers to the above, and whatever temporal resolution you need (hourly intervals by the hour, minute, or second) I probably wouldn't bother with arrays. Instead, I'd generate a record for each interval between the the time a person entered the emergency roon and the time s/he left (one record an hour, or one record a minute, or one record a second, or whatever) and then count the total number of records for each timepoint using PROC MEANS. ```

Back to: Top of message | Previous page | Main SAS-L page