On 10/30/2013 06:00 AM, r-help-request at r-project.org
wrote:> Hi,
>
> I'm having the following loop:
>
> result<- vector("list",100)
> for (i in 1:max(dat$simNumber))
> {
result[[i]]<-survfit(Surv(dat[dat$simNumber==i,]$TAFD,dat[dat$simNumber==i,]$DV)~1)
>
> }
>
> In a next step, I would like to calculate the mean, 5% and 95% PI of the
Kaplan-Meier estimates of the 100 simulated problems stored under result in the
result[[i]]$surv.
>
> Can anyone help me with this?
>
> Tx!
>
I don't know what a "95% PI" is, but for the mean survival I can
help.
options(survfit.rmean="common") #defaults to "none" in the
routine
means <- lapply(result, function(x) summary(x)$table[5:6])
This gives a list, each element of which is the estimated mean and se(mean) for
that curve.
Terry Therneau