Hi,
I would like to make a Kaplan-Meier curve using Proc lifetest.
I have a time variable, which was calculated from the interval between two dates. Currently, the unit is in days. How do I covert the the days iinto months so that I can plot the graph with 1-12 months on the X-axis?
Thank you!
Suppose you know the initial date or maybe is part of the data you can calculate the 12
dates by next code:
/* date1 is the initial date */
do m = 1 to 12;
date = intnx('month',date1,m);
putlog m= date= date9.;
end;
Having a sample of your data and posting the wanted output, it will enable to give you more
precise code.
Simply associate the format MONTH3. with your time (days) variable.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.