SAS and R still give median survival time although more than half of the data are censored?

#1
Hi, I was fitting some Kaplan Meier plots for the survival analysis for the data set below.
Capture.JPG
Because there are only two out of five events happening, why are SAS and R still able to give the median survival time, which is 5.9539 (in moths)?

Here are my codes in R:
pfs_fit <- survfit(Surv(pfs_m, pfs_stat) ~ 1, data = data)
os_fit <- survfit(Surv(os_m, os_stat) ~ 1, data = data)
 

hlsmith

Not a robit
#2
I haven't done this much in R, but more experienced in SAS. Can you post the SAS code. I know it is a little tricky to get the code right the first time. censor(0)

Also, look at the plots to make sure they make sense and you don't have event and censored switched.
 
#3
I haven't done this much in R, but more experienced in SAS. Can you post the SAS code. I know it is a little tricky to get the code right the first time. censor(0)

Also, look at the plots to make sure they make sense and you don't have event and censored switched.
Hi, this is my SAS code. I got the same results as R though.

proc lifetest data=data confband=all outsurv=t;
time pfs_m*pfs_stat(0);
/*time os_m*os_stat(0);*/
run;
 

Miner

TS Contributor
#4
Because the survival analysis takes the time of the censored data into account in the calculation. I'm not an R or SAS user, so I don't know which approach they use, but the least squares approach places more weight on the deaths, while the maximum likelihood approach places relatively more weight on the censored times.
 

hlsmith

Not a robit
#5
Yup, when I ran it I got a median survival, see below code:

Code:
data data;
input pfs_stat pfs_m Died;
datalines;
0 13.45 0
1 5.95 1
0 2.70 0
1 4.74 1
0 5.66 0
;

run;

ODS GRAPHICS ON;
proc lifetest data=data
   PLOT = survival(ATRISK = 0 TO 20 BY 1 cb);
   time pfs_m*Died(0);
run;
ODS GRAPHICS OFF;
I am guessing it has to do with the censoring and event happening w/in the same integer (5), when I changed the times to integers it did not provide a median survival.
 
#7
Because the survival analysis takes the time of the censored data into account in the calculation. I'm not an R or SAS user, so I don't know which approach they use, but the least squares approach places more weight on the deaths, while the maximum likelihood approach places relatively more weight on the censored times.
Thank you. I just read the documentation. The survfit() function in R and Proc lifetest in SAS indeed use the maximum likelihood approach.
As @hlsmith mentioned, it is great if you can elaborate a little bit.