Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

selectCox

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 Surv object on the left-hand side and all the variables on the right-hand side.

data

Name of an data frame containing all needed variables.

rule

The method for selecting variables. See fastbw for details.

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 https://www.jstatsoft.org/v50/i11.

Examples

data(GBSG2)
library(survival)
f <- selectCox(Surv(time,cens)~horTh+age+menostat+tsize+tgrade+pnodes+progrec+estrec ,
	       data=GBSG2)

pec

Prediction Error Curves for Risk Prediction Models in Survival Analysis

v2020.11.17
GPL (>= 2)
Authors
Thomas A. Gerds
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.