Description Usage Arguments Value Note Examples
Predicts survival or quantiles from Parametric Survival Models that were fitted
using survreg. Unlike with predict.survreg.penal,
predictions are population averages (i.e. the frailty effect is fixed at its
mean). The confidence bounds of the predictions are determined using nonparametric
bootstrap resampling.
1 2 3 |
model |
An object of class |
data |
The data used to fit |
strata |
The name of the variable in |
type |
A character string: one of |
quantiles |
A numeric vector of survival quantiles for which the times are predicted. |
times |
A numeric vector of survival times for which the survival percentage should be predicted. |
conf.int |
|
R |
The number of bootstrap replicates. Passed to |
parallel |
Passed to |
ncpus |
Passed to |
... |
Further arguments passed to |
A list with one element per predictor level combination that contains a data frame with one row and columns for the predictors, and a one or three column matrix (point prediction, lower and upper confidence limit). For each desired time / survival quantile, one row in the matrix is returned.
Predictions are returned for all levels of all predictors (quantitative predictors not tested yet).
Unlike boot, if ncpus = NULL and parallel != "no"
all but one or two CPU are used on UNIX-Systems and on other platforms, respectively.
1 2 3 4 5 6 7 8 | intS2 <- with(MIC, create_int2Surv(concentration, inhibition))
psm <- survival::survreg(as.formula("intS2 ~ region +
frailty(herd, sparse = FALSE)"), data = cbind(intS2, MIC))
predict_survreg(psm, data = cbind(intS2, MIC), strata = "herd",
conf.int = 0.95, parallel = "snow")
predict_survreg(psm, data = cbind(intS2, MIC), strata = "herd",
type = "survival", times = c(0.5, 1), conf.int = 0.95, parallel = "snow")
rm(psm, intS2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.