HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Program Files/R/R-4.4.0/library/survival/tests/survfit2.Rout.save
R Under development (unstable) (2019-01-23 r76006) -- "Unsuffered Consequences"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(survival)
> #
> # Check out the Dory&Korn confidence interval option
> #
> tdata <- data.frame(time= 1:10,
+                     status=c(1,0,1,0,1,0,0,0,1,0))
> 
> fit1 <- survfit(Surv(time, status) ~1, tdata, conf.lower='modified')
> fit2 <- survfit(Surv(time, status) ~1, tdata)
> 
> stdlow <- fit2$std.err * sqrt(c(1, 10/9, 1, 8/7, 1, 6/5, 6/4, 6/3, 1, 2/1))
> lower <- exp(log(fit2$surv) - qnorm(.975)*stdlow)
> all.equal(fit1$lower, lower, check.attributes=FALSE)
[1] TRUE
> 
> proc.time()
   user  system elapsed 
  0.748   0.036   0.786