Hello, I want to sort my dataset. The original data looks like below: The dataset mainly contains two kind of variables: time of the event, and event (each event has a continuous value). The "time 1" is the time of "event 1", "time 2" is the time of "event 2", and so on. "Time 1" to "time 7" are listed in chronological order, so "time 1" is always earlier than or same to "time 2" because event 1 and 2, or event 2 and 3 and 4, or all 7 events could happen at the same time. Each participant could have at least 1 up to 7 events.
But I want to redesign this dataset in a summary way. I want to plus the value of the events that happened at the same time, and make a table that variables are the 24 hours. So the goal is to make a new dataset looks below:
I have some idea about how to do this, but I don't know how to apply my idea into SAS code.
Step 1: assign each time a continuous value: for example, "time 1" is 6:45, so "new time 1" could be 6X60+45=405, but I don't know how to assign this value on all the time of all participants.
Step 2: combine events' value together when they happened at the same time. But I don't know how to link the time and the event together.
Step 3: put the final event value under the new time variable like "6:00-7:00".
I tried to do this, however, due to my limited knowledge about SAS, I dont know how to achieve this in SAS. So I hope you could help me with this.
Last, after I create the new dataset, I want to know when each participant has the highest value of event during the day. Can I generate a new dataset looks like below:
Thank you very much!