|subject||timepoint(hour)||time of assessment||NRS score||medication||how to get hour 1||how to get hour 4|
|101-0011||1||11:13:00||3||the green time happened before the medication record, so they are one group. The maximum is 6|
|101-0011||2||12:13:00||7||these red time records before 15:21:00, so set them as one group. 8 is the maximum number inside, so we pick up 8|
|101-0011||4||13:59:59||6||I pick up smaller ones between the upper group and down group, so it is 6|
|101-0011||14:20:00😁||8||A||14:20:00+6:00:00=20:20:00||all small faces in one group because they happened before 20:20:00. The maximum score is 9. All assessment time before hour 4 is one group, the maximum is 8. The same, pick up the smaller one between 8 and 9 as hour 4 score|
|101-0011||8||18:15:00😁||8||these purple time record before 22:00:00 is one group. 9 is the maximum number inside, so we pick up 9. The maximum NRS score which the assessment time before 18:00:00 is 8. so the final score for hour 6 is 8|
My desire output:
|101-0011||2||7||hour 2 has no record for medication, so just keep NRS score.|
currently I have this data. I need to find NRS score for each timepoint. the method is according to medication, for medication O(add 8 hour in A), I should add 4 hour downward from corresponding time of assessment, I pick up the the max NRS score in this time range. I still need to pick up a max NRS score up this timepoint, and then compare them. keep the smaller one as this timepoint final score.
I spent two days and did not figure out how to do it. is there anyone can give me a help. Appreciate
Please show us the desired output.
Please explain further about what impact medication has on the analysis. What should we do about medication "A"? What if there are other medications?
Is the data really as you show it, with the first date and time assessment is 20Mar2023:0900:59.96 and the rest are just the time but no date?
But this is not what I asked for, I want you to create a column in your original data table that has the desired result. I do not see any relationship between your first table and your second table, and can't make any use of your second table.
sorry, I show the process with the first medication O at timepoint 1, the start assessment time is 11:21:00, then add 4 hr downward, so the last timepoint is 14:20:00, the maximum score is 8 in this range. the maximum score upward from 11:21:00 is 6. I pick up smaller one between 6 and 8 as my desired score.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.