tenf.crr {QHScrnomo} | R Documentation |
Obtain K-Fold Cross-Validated Predictions
Description
Computes "out-of-sample" predictions by K-fold cross-validation for each observation in the modeling data set from a crr.fit
object.
Usage
tenf.crr(fit, time = NULL, lps = FALSE, fold = 10, trace = TRUE)
Arguments
fit |
A model fit by |
time |
A single time point to calculate the failure probability |
lps |
Should the linear predictor be returned instead of the failure probability? Defaults to |
fold |
The number of folds. Defaults to |
trace |
Should the progress of cross-validation be printed to the console? Defaults to |
Value
A vector of failure probabilities at the specified time point (or linear predictors if lps=TRUE
) with length equal to the number of rows in the original data set.
Author(s)
Changhong Yu, Michael Kattan, Ph.D
Department of Quantitative
Health Sciences
Cleveland Clinic
See Also
Examples
dd <- datadist(prostate.dat)
options(datadist = "dd")
prostate.f <- cph(Surv(TIME_EVENT,EVENT_DOD == 1) ~ TX + rcs(PSA,3) +
BX_GLSN_CAT + CLIN_STG + rcs(AGE,3) +
RACE_AA, data = prostate.dat,
x = TRUE, y = TRUE, surv = TRUE,time.inc = 144)
prostate.crr <- crr.fit(prostate.f, cencode = 0, failcode = 1)
tenf.crr(prostate.crr, time = 120, fold = 2)
[Package QHScrnomo version 3.0.1 Index]