survfit.yppe {YPPE} | R Documentation |
Survival function for the YPPE model
Description
Survival function for the YPPE model
Usage
## S3 method for class 'yppe'
survfit(object, newdata, ...)
Arguments
object |
an object of the class yppe |
newdata |
a data frame containing the set of explanatory variables. |
... |
further arguments passed to or from other methods. |
Value
a list containing the estimated survival probabilities.
Examples
# ML approach:
library(YPPE)
mle <- yppe(Surv(time, status)~arm, data=ipass, approach="mle")
summary(mle)
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)
# Bayesian approach:
bayes <- yppe(Surv(time, status)~arm, data=ipass, approach="bayes")
summary(bayes)
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)
[Package YPPE version 1.0.1 Index]