Skip to contents

This function orders the predictors by decreasing order of the magnitude of the estimated regression coefficient.

Usage

absolute.order(beta)

Arguments

beta

A vector of estimated regression coefficients.

Value

An ordering of the predictors.

Examples

### generate synthetic data
set.seed(1)
n           = 200
p           = 300
X           = matrix(rnorm(n*p),n,p)
beta        = double(p)
beta[1:10]  = 1:10
y           = X %*% beta + rnorm(n)

### order predictors by magnitude of univariate regression coefficient
beta.hat    = univariate_regression(X,y)$betahat
order       = absolute.order(beta.hat)