BookmarkSubscribeRSS Feed
Denali
Quartz | Level 8

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!

 

2 REPLIES 2
Shmuel
Garnet | Level 18

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.

 

PGStats
Opal | Level 21

Simply associate the format MONTH3. with your time (days) variable.

PG

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1038 views
  • 0 likes
  • 3 in conversation