crossTime.yppe {YPPE} | R Documentation |
Computes the crossing survival times
Description
Computes the crossing survival times
Usage
## S3 method for class 'yppe'
crossTime(object, newdata1, newdata2, conf.level = 0.95, nboot = 4000, ...)
Arguments
object |
an object of class yppe |
newdata1 |
a data frame containing the first set of explanatory variables |
newdata2 |
a data frame containing the second set of explanatory variables |
conf.level |
level of the confidence/credible intervals |
nboot |
number of bootstrap samples (default nboot=4000); ignored if approach="bayes". |
... |
further arguments passed to or from other methods. |
Value
the crossing survival time
Examples
# ML approach:
library(YPPE)
mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle")
summary(mle)
newdata1 <- data.frame(arm=0)
newdata2 <- data.frame(arm=1)
tcross <- crossTime(mle, newdata1, newdata2)
tcross
ekm <- survfit(Surv(time, status)~arm, data=ipass)
newdata <- data.frame(arm=0:1)
St <- survfit(mle, newdata)
time <- sort(ipass$time)
plot(ekm, col=1:2)
lines(time, St[[1]])
lines(time, St[[2]], col=2)
abline(v=tcross, col="blue")
# Bayesian approach:
bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes")
summary(bayes)
newdata1 <- data.frame(arm=0)
newdata2 <- data.frame(arm=1)
tcross <- crossTime(bayes, newdata1, newdata2)
tcross
ekm <- survfit(Surv(time, status)~arm, data=ipass)
newdata <- data.frame(arm=0:1)
St <- survfit(bayes, newdata)
time <- sort(ipass$time)
plot(ekm, col=1:2)
lines(time, St[[1]])
lines(time, St[[2]], col=2)
abline(v=tcross, col="blue")
[Package YPPE version 1.0.1 Index]