univar.order: Ordering of Predictors from Univariate Regression

View source: R/misc.R

univar.orderR Documentation

Ordering of Predictors from Univariate Regression

Description

This function extracts the ordering of the predictors according to the coefficients estimated in a basic univariate regression; in particular, the predictors are ordered in decreasing order by magnitude of the univariate regression coefficient estimate.

Usage

univar.order(X, y)

Arguments

X

An input design matrix. This may be centered and/or standardized prior to calling function.

y

A vector of response variables.

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)

univ.order = univar.order(X,y)


stephenslab/mr.ash.alpha documentation built on Oct. 31, 2023, 4:21 p.m.