knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "tools/README-"
)
options(tibble.width = Inf)

blorr

Tools for building binary logistic regression models

CRAN_Status_Badge R-CMD-check Coverage status

Overview

Tools designed to make it easier for users, particularly beginner/intermediate R users to build logistic regression models. Includes comprehensive regression output, variable selection procedures, model validation techniques and a 'shiny' app for interactive model building.

Installation

# Install blorr from CRAN
install.packages("blorr")

# Install development version from GitHub
# install.packages("devtools")
devtools::install_github("rsquaredacademy/blorr")

# Install the development version from `rsquaredacademy` universe
install.packages("blorr", repos = "https://rsquaredacademy.r-universe.dev")

Articles

Usage

blorr uses consistent prefix blr_* for easy tab completion.

library(blorr)
library(magrittr)

Bivariate Analysis

blr_bivariate_analysis(hsb2, honcomp, female, prog, race, schtyp)

Weight of Evidence & Information Value

blr_woe_iv(hsb2, prog, honcomp)

Model

# create model using glm
model <- glm(honcomp ~ female + read + science, data = hsb2,
             family = binomial(link = 'logit'))

Regression Output

blr_regress(model)

Model Fit Statistics

blr_model_fit_stats(model)

Confusion Matrix

blr_confusion_matrix(model)

Hosmer Lemeshow Test

blr_test_hosmer_lemeshow(model)

Gains Table

blr_gains_table(model)

Lift Chart

model %>%
  blr_gains_table() %>%
  plot()

ROC Curve

model %>%
  blr_gains_table() %>%
  blr_roc_curve()

KS Chart

model %>%
  blr_gains_table() %>%
  blr_ks_chart()

Lorenz Curve

blr_lorenz_curve(model)

Getting Help

If you encounter a bug, please file a minimal reproducible example using reprex on github. For questions and clarifications, use StackOverflow.

Code of Conduct

Please note that the blorr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



rsquaredacademy/blorr documentation built on Nov. 12, 2024, 1:44 a.m.