predict.prodlim {prodlim} | R Documentation |
Evaluation of estimated survival or event probabilities at given times and covariate constellations.
## S3 method for class 'prodlim' predict(object, times, newdata, level.chaos = 1, type = c("surv", "cuminc", "list"), mode = "list", bytime = FALSE, cause = 1, ...)
object |
A fitted object of class "prodlim". |
times |
Vector of times at which to return the estimated probabilities. |
newdata |
A data frame with the same variable names as those that appear on the right hand side of the 'prodlim' formula. If there are covariates this argument is required. |
level.chaos |
Integer specifying the sorting of the output: ‘0’ sort by time and newdata; ‘1’ only by time; ‘2’ no sorting at all |
type |
Choice between "surv","cuminc","list": "surv": predict survival probabilities only survival models "cuminc": predict cumulative incidences only competing risk models "list": find the indices corresponding to times and newdata. See value. Defaults to "surv" for two-state models and to "cuminc" for competing risk models. |
mode |
Only for |
bytime |
Logical. If TRUE and |
cause |
The cause for predicting the cause-specific cumulative incidence function in competing risk models. |
... |
Only for compatibility reasons. |
Predicted (survival) probabilities are returned that can be plotted, summarized and used for inverse of probability of censoring weighting.
type=="surv"
A list or a matrix with survival probabilities
for all times and all newdata.
type=="cuminc"
A list or a matrix with cumulative incidences for all
times and all newdata.
type=="list"
A list with the following components:
times |
The argument |
predictors |
The relevant part of the argument |
indices |
A list with the following components
|
dimensions |
a list with the following
components: |
Thomas Alexander Gerds <tag@biostat.ku.dk>
dat <- SimSurv(400) fit <- prodlim(Hist(time,status)~1,data=dat) ## predict the survival probs at selected times predict(fit,times=c(10,100,1000)) ## works also outside the usual range of the Kaplan-Meier predict(fit,times=c(-1,0,10,100,1000,10000)) ## newdata is required if there are strata ## or neighborhoods (i.e. overlapping strata) mfit <- prodlim(Hist(time,status)~X1+X2,data=dat) predict(mfit,times=c(-1,0,10,100,1000,10000),newdata=dat[18:21,]) ## this can be requested in matrix form predict(mfit,times=c(-1,0,10,100,1000,10000),newdata=dat[18:21,],mode="matrix") ## and even transposed predict(mfit,times=c(-1,0,10,100,1000,10000),newdata=dat[18:21,],mode="matrix",bytime=TRUE)