qsurv {rsurv} | R Documentation |
Generic quantile function
Description
Generic quantile function used internally to simulating from an arbitrary baseline survival distribution.
Usage
qsurv(p, baseline, package = NULL, ...)
Arguments
p |
vector of quantiles associated with the right tail area of the baseline survival distribution. |
baseline |
the name of the baseline distribution. |
package |
the name of the package where the baseline distribution is implemented. It ensures that the right quantile function from the right package is found, regardless of the current R search path. |
... |
further arguments passed to other methods. |
Value
a vector of quantiles.
Examples
library(rsurv)
set.seed(1234567890)
u <- sort(runif(5))
x1 <- qexp(u, rate = 1, lower.tail = FALSE)
x2 <- qsurv(u, baseline = "exp", rate = 1)
x3 <- qsurv(u, baseline = "exp", rate = 1, package = "stats")
x4 <- qsurv(u, baseline = "gengamma.orig", shape=1, scale=1, k=1, package = "flexsurv")
cbind(x1, x2, x3, x4)
[Package rsurv version 0.0.2 Index]