Obtain bootstrap replicates of the median survival time for different groups of subjects. We can compute confidence intervals using boot package.

1 |

`formula` |
A formula object. If a formula object is supplied it must have a Survr object as the response on the left of the ~ operator and a term on the right. For a single bootstrap median survival the "~1" part of the formula is required. |

`data` |
A data frame in wich to interpret the variables named in the formula. |

`q` |
Quantile that we are interested in to obtain a bootstrap sample from survival function |

`B` |
Number of boostrap samples |

`boot.F` |
a character string specifying the boostrap procedure. Possible value are either "PSH" or "WC" for nonparametric boostrap or "semiparametric" for semiparametric boostrap. The default is "WC". Only the first words are required, e.g "P","W","se" |

`boot.G` |
a character string specifying if we also resample form censored empirical distribution. Possible value are either "none" or "empirical". The default is "none". Only the first words are required, e.g "n","e" |

`...` |
additional arguments passed to the type of estimator. |

See reference. Some procedures can be slow

A boot object. Bootstrap confidence intervals can be computed using boot.ci function from boot package

Gonzalez JR, Pe<f1>a EA. Bootstraping median survival with recurrent event data. IX Conferencia Espa<f1>ola de Biometr<ed>a; 2003 May 28-30; A Coru<f1>a, Espa<f1>a.

Paper available upon request to the mantainer

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ```
data(colon)
#We will compare the median survival time for three dukes stages
fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5)
boot.ci(fit$"1", type=c("norm","basic", "perc"))
boot.ci(fit$"2", type=c("norm","basic", "perc"))
boot.ci(fit$"3", type=c("norm","basic", "perc"))
# 75th quantile of survival function
fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.75)
# bootstrap percentile confidence interval
quantile(fit$"1"$t,c(0.025,0.975))
quantile(fit$"2"$t,c(0.025,0.975))
quantile(fit$"3"$t,c(0.025,0.975))
# We could execute this if there is none Inf value
# boot.ci(fit$"1")
# boot.ci(fit$"2")
# boot.ci(fit$"3")
# We can modify the bootstrap procedure modifiying boot.F parameter
fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5,boot.F="PSH")
# bootstrap percentile confidence interval
quantile(fit$"1"$t,c(0.025,0.975))
quantile(fit$"2"$t,c(0.025,0.975))
quantile(fit$"3"$t,c(0.025,0.975))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.