BookmarkSubscribeRSS Feed
sophielr
Fluorite | Level 6

sophielr_1-1682005317626.png

subjecttimepoint(hour)time of assessmentNRS scoremedicationhow to get hour 1how to get hour 4
101-0011009:00:596   
101-0011111:13:003 the green time happened before the medication record, so they are one group. The maximum is 6 
101-0011 11:21:008O11:21:00+4:00:00=15:21:00 
101-0011212:13:007 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-0011413:59:596 I pick up smaller ones between the upper group and down group, so it is 6 
101-0011 14:20:00😁8A14:20:00+6:00:00=20:20:00all 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-0011616:15:00😁8   
101-0011 18:00:00😁7O18:00:00+4:00:00=22:00:00 
101-0011818: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 
101-0011 20:00:00😁9O  
101-00111020:15:00😁9   
101-00111222:05:007   

 

My desire output:

 

subjecttimepoint(hour)score 
101-001106 
101-001116 
101-001127hour 2 has no record for medication, so just keep NRS score.       
101-001148 
101-001168 
101-0011109 

 

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

16 REPLIES 16
PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
sophielr
Fluorite | Level 6

sophielr_0-1682004308848.png

 

 

Thank you for getting back to me so quickly. I just need to find out score for different time point by sas. there are two medication, A and O, A has 4 hr time extension and O has 8 hr time extension. data is fine.

 

 

PaigeMiller
Diamond | Level 26

How about you go back to the spreadsheet shown in your original reply, and create a new column with the desired results, and show that to us?

--
Paige Miller
sophielr
Fluorite | Level 6

I modified my original post.

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
sophielr
Fluorite | Level 6

sophielr_0-1682006029469.png

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. 

Reeza
Super User

Please provide data as text and more than one example as otherwise the solution provided will not meet your requirements. 

 

sophielr
Fluorite | Level 6

Thank you. I update them in my first poster

Reeza
Super User
Does your timepoint variable have anything to do with your time points? Does it define the time periods?
sophielr
Fluorite | Level 6

No, it is just a time point. hour 1/ hour 2, and so on.

Reeza
Super User
So the timepoint in the output has nothing to do with the time point variable in the input data set?
sophielr
Fluorite | Level 6

the time point in raw data is the same as the hour in output form.

Reeza
Super User
You've called it "hour" in image and "timepoint" in text and I genuinely can't follow the logic with the data.

How is 1 mapped to 6, how is 4 mapped to 8?

Can you explain the calculation for each timepoint? And please clean up the data to show one input/output that have the appropriate variable name.
sophielr
Fluorite | Level 6

sorry, I did not explain clearly. I did some modify to my first poster.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 16 replies
  • 1324 views
  • 0 likes
  • 3 in conversation