BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
_maldini_
Barite | Level 11

What is the correct syntax for requesting specific statistics when doing survival analyses using PROC LIFETEST?

 

proc lifetest data=STAN.MELANOMA plots=survival graphics;
/* (0) The value 0 indicates a censored individual in this dataset. */
	time person_years*status(0);
/* 	strata statement produces a table for each stratum. */
/* 	The log rank test p-value tells you if the strata differ. */
	strata ulcer;
run;

For example, I want to request the median survival time and the survival probability at 10 years for one group in the STRATA statement (i.e., ulcer = 1, ulcer = 0 = no ulcer).

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Use the TIMELIST option on  for specifying survival at 10 years. 

The median survival should be reported by default in the quartiles table.

 

I have a survival macro that does some standard reporting that you can check out but it's probably more than a decade old now.

 

https://gist.github.com/statgeek/d3bce2a9e2ef0523db9d

 

proc lifetest data=STAN.MELANOMA timelist=(10) plots=survival graphics;
/* (0) The value 0 indicates a censored individual in this dataset. */
	time person_years*status(0);
/* 	strata statement produces a table for each stratum. */
/* 	The log rank test p-value tells you if the strata differ. */
	strata ulcer;
run;

This assumes that your time is in years otherwise you'll need to do some unit conversions for the time.

 


@_maldini_ wrote:

What is the correct syntax for requesting specific statistics when doing survival analyses using PROC LIFETEST?

 

proc lifetest data=STAN.MELANOMA plots=survival graphics;
/* (0) The value 0 indicates a censored individual in this dataset. */
	time person_years*status(0);
/* 	strata statement produces a table for each stratum. */
/* 	The log rank test p-value tells you if the strata differ. */
	strata ulcer;
run;

For example, I want to request the median survival time and the survival probability at 10 years for one group in the STRATA statement (i.e., ulcer = 1, ulcer = 0 = no ulcer).

 

 


 

View solution in original post

1 REPLY 1
Reeza
Super User

Use the TIMELIST option on  for specifying survival at 10 years. 

The median survival should be reported by default in the quartiles table.

 

I have a survival macro that does some standard reporting that you can check out but it's probably more than a decade old now.

 

https://gist.github.com/statgeek/d3bce2a9e2ef0523db9d

 

proc lifetest data=STAN.MELANOMA timelist=(10) plots=survival graphics;
/* (0) The value 0 indicates a censored individual in this dataset. */
	time person_years*status(0);
/* 	strata statement produces a table for each stratum. */
/* 	The log rank test p-value tells you if the strata differ. */
	strata ulcer;
run;

This assumes that your time is in years otherwise you'll need to do some unit conversions for the time.

 


@_maldini_ wrote:

What is the correct syntax for requesting specific statistics when doing survival analyses using PROC LIFETEST?

 

proc lifetest data=STAN.MELANOMA plots=survival graphics;
/* (0) The value 0 indicates a censored individual in this dataset. */
	time person_years*status(0);
/* 	strata statement produces a table for each stratum. */
/* 	The log rank test p-value tells you if the strata differ. */
	strata ulcer;
run;

For example, I want to request the median survival time and the survival probability at 10 years for one group in the STRATA statement (i.e., ulcer = 1, ulcer = 0 = no ulcer).

 

 


 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 662 views
  • 2 likes
  • 2 in conversation