Learn R Programming

explore (version 1.3.4)

explain_logreg: Explain a binary target using a logistic regression (glm). Model chosen by AIC in a Stepwise Algorithm (MASS::stepAIC()).

Description

Explain a binary target using a logistic regression (glm). Model chosen by AIC in a Stepwise Algorithm (MASS::stepAIC()).

Usage

explain_logreg(data, target, out = "tibble", ...)

Value

Dataset with results (term, estimate, std.error, z.value, p.value)

Arguments

data

A dataset

target

Target variable (binary)

out

Output of the function: "tibble" | "model"

...

Further arguments

Examples

Run this code
data <- iris
data$is_versicolor <- ifelse(iris$Species == "versicolor", 1, 0)
data$Species <- NULL
explain_logreg(data, target = is_versicolor)

Run the code above in your browser using DataLab