var_select: Select the 'best' variables to include in a linear model

View source: R/var_select.R

var_selectR Documentation

Select the 'best' variables to include in a linear model

Description

This is an implementation of a simple algorithm that selects the 'best' variables as the predictors in a linear regression model. The selection is based on choosing the variables that give the highest adjusted R-squared value.

Usage

var_select(data, y, stopat = Inf)

Arguments

data

A data frame containing the predictor variables (X) and the dependent variable (Y).

y

The name of the dependent variable.

stopat

The total number of variables to include in the model. Default is Inf which means using all the variables in the data frame.

Value

A nested tibble with the lm models and stats.


MohoWu/ricardor documentation built on March 24, 2022, 4:39 p.m.