log_reg: Custom function for logistic regression

Description Usage Arguments Details Value Note Author(s)

View source: R/PredFuncAC.R

Description

This function takes training data, tesing data, target variable and predict the probability score of target variable = 1.Target varibale of training data should contain 1 and 0 only.

Usage

1
log_reg(train, test, vif = 10, 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 where probability score needs to be predicted

drop

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

Details

This is a custom function for logistic regression, it builds a logistic 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 logistic model and predict the target variable on the training data.

Value

The value returns is the probability score of target variable = 1 as a numeric vector.

Note

The target variable column of training data should contain in 1 or 0 only.

Author(s)

ABIR CHAKRABORTY < mail2abirchakraborty@gmail.com >


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