BookmarkSubscribeRSS Feed
Costco
Calcite | Level 5

Hi,

 

I am trying to create a time variable that has the maximum follow up time for each patient. Each patient has 6 different stratums (stratum 1, 2, 3, 4, 5, 6). Within each stratum are different times when a different event of interest occurs. Stratum 6 has the longest follow up time. Other than deleting stratums 1-5 and just using stratum 6, is there a way program so that it will select for the highest number for each stratum? Like function like Max or etc?

 

Thanks for all of your help

2 REPLIES 2
Astounding
PROC Star

Of course SAS can do this.  Easily.

 

But the answer depends on what is in your data.

 

Do you have one observation per patient, with information for all 6 stratum values on the same observations?

 

Do you have up to 6 observations per patient with STRATUM taking on a value from 1 to 6?

 

And given the structure of your data now, what do you envision as the final structure once the maximum is calculated?

ballardw
Super User

Example data in the form of a data step.

If you expect a data set as a result, then the result for the example data in the form of a data step.

Cases of different types should be represented.

 

The data step is important because it provides actual details about variables and content that otherwise we get to spend time having to ask for each.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

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
  • 2 replies
  • 249 views
  • 0 likes
  • 3 in conversation