Hi StataList,
I have another question I was hoping you friendly folks can help me with.
I have a dataset that includes variable id, day, and time. Each id represents an individual event that occurred on a specific day at a specific time. Many events occur every hour of each day. Day is coded as a number 1 through 12. Time is coded as a number 0.00 through 23.00.
I want to create a variable that contains the number of events that occurred over the next 1 hour period after the time of the current event.
So for example, id = 1 starts on day = 1 and the first event is at time = 17.25. I would like to create a new variable 1hr which would equal the number of events that occur between 17.25 and 18.25. Then if id = 2 starts on day = 1 and time = 17.30, 1hr would equal the number of events from 17.30 and 18.30.
I hope this is clear. I really appreciate your help.
Best,
Rich
I have another question I was hoping you friendly folks can help me with.
I have a dataset that includes variable id, day, and time. Each id represents an individual event that occurred on a specific day at a specific time. Many events occur every hour of each day. Day is coded as a number 1 through 12. Time is coded as a number 0.00 through 23.00.
I want to create a variable that contains the number of events that occurred over the next 1 hour period after the time of the current event.
So for example, id = 1 starts on day = 1 and the first event is at time = 17.25. I would like to create a new variable 1hr which would equal the number of events that occur between 17.25 and 18.25. Then if id = 2 starts on day = 1 and time = 17.30, 1hr would equal the number of events from 17.30 and 18.30.
I hope this is clear. I really appreciate your help.
Best,
Rich
Comment