BookmarkSubscribeRSS Feed
carl_miles
Obsidian | Level 7
data Patients;
    format Diagnosis_Date Followup_Date date9.;
    input Patient_ID $ Diagnosis_Date :date9. Followup_Date :date9. Obs Age Gender $ Condition $ Treatment $ Event $ event_fl;
    Days = Followup_Date - Diagnosis_Date;
    Months = (Followup_Date - Diagnosis_Date)/30;
    datalines;
P001 05OCT2011 03JUL2015 1 45 Male Hyperten DrugA No 0
P002 13MAY2011 21MAY2011 2 60 Female Diabetes DrugB Yes 1
P003 17OCT2011 07NOV2015 3 50 Male HeartDis DrugA No 0
P004 08NOV2011 17NOV2016 4 39 Female Hyperten DrugC Yes 1
P005 16JUN2011 11FEB2015 5 48 Male Diabetes DrugB No 0
P006 11FEB2011 07NOV2014 6 55 Female Obesity DrugD Yes 1
P007 16JUN2011 10SEP2015 7 65 Male Hyperten DrugA Yes 1
P008 01NOV2011 09JAN2015 8 70 Female HeartDis DrugE No 0
P009 17MAR2011 11JUL2014 9 52 Male Diabetes DrugB Yes 1
P010 09NOV2011 05OCT2014 10 46 Female Obesity DrugC Yes 1
;
run;

proc print data=Patients;
    title "Patients Dataset with Days Between Diagnosis and Follow-up Dates";
run;

proc lifetest data = Patients method=km plots=survival (cb = hw test atrisk) timelist=25 30 35 40 45; 
              time Months*event_fl(0);
              title "Kaplan Meier Analysis on time to death";
              label Months = "Time to Death";

Hi Guys,

The attached code snippet is a sample data 
this is KM survival analysis using proc lifetest 

timelist=25 30 35 40 45

this is the timelist i using to find survival probability at 25th month, and 30th month ..... like that 

along with that i need to find the survival at >50 months 
i tried mentioning timelist=25 30 35 40 45 >50 

this is not giving any results so i want to find a way to find survival probability at >50 (Note: I want to mention excatly >50)

Kindly give your inputs guys





2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @carl_miles,

 

Just omit the ">" sign in the TIMELIST= option. The survival function S(t), which you estimate using the Kaplan-Meier method, is defined as the probability of the survival time being greater than t. So the ">" sign is implied and applies also to 25, 30, ... anyway.

Ksharp
Super User

As   said, the value at time=50 is SDF, SDF=1-CDF , it is  maybe just what you are looking for >50.

proc lifetest data = Patients method=km  plots=survival (cb = hw test atrisk) timelist=25 30 35 40 45 50; 
              time Months*event_fl(0);
              title "Kaplan Meier Analysis on time to death";
              label Months = "Time to Death";
			run;

Ksharp_0-1736663665933.png

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1172 views
  • 3 likes
  • 3 in conversation