lin_reg: Custom function for linear regression

Description Usage Arguments Details Value Author(s)

View source: R/PredFuncAC.R

Description

This function takes training data, tesing data, target variable and predict target variable of the training data

Usage

1
lin_reg(train, test, vif = 5, p = 0.05, target, drop = NULL)

Arguments

train

Training Data as a dataframe.

test

Testing Data as a dataframe.

vif

Cut off value of VIF

p

Cut off of p-value

target

Name of the variable that needs to predict

drop

Name of the variable that needs to be dropped before building the model.

Details

This is a custom function for linear regression, it builds a linear model first on the training data.

The argument 'drop' removes the variables not needed to build the model.

The argument 'vif' set the cut off of VIF and drop the variable with highest vif one by one till the maximum value of vif is less than cut-off.

The argument 'p' set the cut off of p-value and drop the variable with highest p-value one by one till the maximum value of p-value is less than cut-off.

The remaining variables are used to make the final linear model and predict the target variable on the training data.

Value

The value returns from this function is a numeric vector.

Author(s)

ABIR CHAKRABORTY < mail2abirchakraborty@gmail.com >


AbirChakraborty1/RegFunction documentation built on Feb. 25, 2022, 12:22 p.m.