Learn R Programming

SecDim (version 3.2)

selectvarlm: Selecting variables using linear regression

Description

Function for selecting variables using linear regression

Usage

selectvarlm(y, x, ctr.vif = 10)

Value

A data.frame of selected variables

Arguments

y

A vector of a response variable

x

A data.frame of explanatory variables

ctr.vif

A number of VIF threshold

Examples

Run this code
data("obs")
data("sample_vars_sda")
obs$Cr_ppm <- log(obs$Cr_ppm)
krm <- rmvoutlier(obs$Cr_ppm)
y <- obs$Cr_ppm[-krm]
x <- sample_vars_sda$Elevation[-krm, 1:11]
sx <- selectvarlm(y, x)

Run the code above in your browser using DataLab