selectCox {riskRegression} | R Documentation |
Backward variable selection in the Cox regression model
Description
This is a wrapper function which first selects variables in the Cox
regression model using fastbw
from the rms
package and then
returns a fitted Cox regression model with the selected variables.
Usage
selectCox(formula, data, rule = "aic")
Arguments
formula |
A formula object with a |
data |
Name of an data frame containing all needed variables. |
rule |
The method for selecting variables. See |
Details
This function first calls cph
then fastbw
and finally
cph
again.
References
Ulla B. Mogensen, Hemant Ishwaran, Thomas A. Gerds (2012). Evaluating Random Forests for Survival Analysis Using Prediction Error Curves. Journal of Statistical Software, 50(11), 1-23. URL http://www.jstatsoft.org/v50/i11/.
Examples
library(survival)
set.seed(74)
d <- sampleData(89,outcome="survival")
f <- selectCox(Surv(time,event)~X1+X2+X3+X4+X6+X7+X8+X9, data=d)
[Package riskRegression version 2023.12.21 Index]