3
$\begingroup$

Hello I am learning about Survival Analysis and I noticed that SAS and R survival package produce different confidence interval estimates for the median Survival times and I was curious why?

Generating my simulated data in R

set.seed(123)
library(survival)
size <-  100

deathtime <- rexp(size, rate = 1)
censor <- abs(rbinom(size, 1, .1) -1)



df <- data.frame(deathtime, censor)
#write.csv(df, "TestData.csv") #For uses in SAS

Using the Survival package

surv.obj <- Surv(df$deathtime, df$censor)

survfit(surv.obj ~ 1)

enter image description here

Using SAS

proc import datafile="P:\SAS\Interval\TestData.csv" out = test;
run;

PROC LIFETEST PLOTS=(S) METHOD=PL;                                                    
     TIME   deathtime *censor(0) ;                                                                                                                 
 RUN;

enter image description here

Question

The point estimate is the same though the confidence intervals differs why?

$\endgroup$
2
  • 2
    $\begingroup$ Have you tried other transform? According to the LIFETEST procedure you can choose the transform using the CONFTYPE option documentation.sas.com/doc/en/statug/15.2/…. More details regarding computation of the confidence interval are given on page 33 here support.sas.com/documentation/onlinedoc/stat/141/lifetest.pdf $\endgroup$
    – periwinkle
    Oct 13 '21 at 18:11
  • 1
    $\begingroup$ Yes @periwinkle as mentioned by EdM R has the conf.type argument to change the transform whose default is Log and SAS has the CONFTYPE to change the transform which default is log log. We figured it out $\endgroup$
    – Vefeagins
    Oct 13 '21 at 18:34
5
$\begingroup$

There are several ways to compute confidence intervals (CI) for survival curves. The SAS output suggests that it uses a log-log method based on $\log(-\log(\text{survival}))$.

Check the R documentation for survfit.formula to see its options for CI estimation. There is a default method for that function in R that isn't log-log. See what happens when you specify "log-log" as the method in R. Then, as suggested in a comment on your question, see what happens when you use SAS with different CI options.

$\endgroup$
2
  • 3
    $\begingroup$ Yes survfit(surv.obj ~ 1, conf.type = "log-log") Produced the same results as SAS $\endgroup$
    – Vefeagins
    Oct 13 '21 at 18:25
  • 3
    $\begingroup$ And adding a to SAS CONFTYPE= LOG leads to the same result in R. $\endgroup$
    – Vefeagins
    Oct 13 '21 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.