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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.