Description Usage Arguments Examples
View source: R/pec-eha-aftreg.R
Calculate prediction error curve
1 2 3 4 5 6 7 |
object |
A fitted model from which to extract predicted survival probabilities |
ipcw.form |
The formula used to calculate inverse probability censoring weights. |
newdata |
A data frame containing predictor variable combinations for which to compute predicted survival probabilities. |
times |
A vector of times in the range of the response variable, e.g. times when the response is a survival object, at which to return the survival probabilities. |
... |
Further arguments passed to |
1 2 3 4 5 6 7 8 9 10 11 12 | library(eha)
data(mort)
mort_train <- mort[1:1000,]
mort_test <- mort[-1:-1000,]
mod <- aftreg(Surv(enter, exit, event) ~ ses, param = "lifeExp",
data = mort_train)
pec <- aft_pec(
mod,
ipcw.form = Surv(time = enter, time2=exit, event = event) ~ ses,
times = seq(0, max(mort_test$exit) - 1, by = 1),
newdata = mort_test)
plot(seq(0, max(mort_test$exit)-1, by = 1), pec, type = "l")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.