back_select: Backwards selcection of linear regression model

Description Usage Arguments Value Examples

View source: R/regSel_code.R

Description

Performs backwards selection of model parameters. Removes parameter with greatest p-value above "prem" threshold. P-values are calculated using Ordinary Least Squares (no weighting option). Must have at least one non-intercept covariate in the model.

Usage

1
back_select(formula, data, prem = 0.1)

Arguments

formula

Model formula using specified columns of DataFrame 'data'. Can include interactions and select no intercept with -1.

data

Dataframe from which model variables are pulled.

prem

Threshold at which a parameter will be removed from the model if it has the highest p-value above the threshold. The default value is .1.

Value

List containing the following elements

Examples

1
2
3
4
5
6
x = rnorm(10)
x2 = rnorm(10)
y = rnorm(10)
df = data.frame(y,x,x2)

back_select(formula = y~x*x2, data = df, prem = .1)

EvanWie/regSel documentation built on Nov. 26, 2019, 2:11 a.m.