# SAS and R survival package have different confidence interval estimates. Why?

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)


### Using SAS

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

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


## Question

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

• 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 Oct 13 '21 at 18:11
• 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 Oct 13 '21 at 18:34

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.
• Yes survfit(surv.obj ~ 1, conf.type = "log-log") Produced the same results as SAS Oct 13 '21 at 18:25
• And adding a to SAS CONFTYPE= LOG leads to the same result in R. Oct 13 '21 at 18:32