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

srstepwise

Stepwise Variable Selection Procedure for survreg


Description

This stepwise variable selection procedure can be applied to obtain the best candidates for a survreg fit.

Usage

srstepwise(x, times, delta, sle = 0.15, sls = 0.15, dist='lognormal')

Arguments

x

Matrix of variables to consider.

times

The time to an event, if any.

delta

The event indicator: 1 for event, 0 for no event.

sle

The chosen significance level for entering.

sls

The chosen significance level for staying.

dist

The distribution to be used by survreg.

Details

Unfortunately, no stepwise procedure exists for survreg models. Therefore, we provide this brute force method.

Value

Returns a list of indices of variables which have entered and stayed.

See Also

Examples

names. <- names(lung)[-(2:3)]
status1 <- ifelse(lung$status==2,1,0)
X <- as.matrix(lung)[ , names.]
vars=srstepwise(X, lung$time, status1)
print(names.[vars])

BART

Bayesian Additive Regression Trees

v2.9
GPL (>= 2)
Authors
Robert McCulloch [aut], Rodney Sparapani [aut, cre], Charles Spanbauer [aut], Robert Gramacy [aut], Matthew Pratola [aut], Martyn Plummer [ctb], Nicky Best [ctb], Kate Cowles [ctb], Karen Vines [ctb]
Initial release
2020-12-21

We don't support your browser anymore

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