-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathREADME.Rmd
More file actions
149 lines (104 loc) · 3.12 KB
/
README.Rmd
File metadata and controls
149 lines (104 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "tools/README-"
)
options(tibble.width = Inf)
```
# blorr
> Tools for building binary logistic regression models
<!-- badges: start -->
[](https://cran.r-project.org/package=blorr)
[](https://github.com/rsquaredacademy/blorr/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/github/rsquaredacademy/blorr?branch=master)
<!-- badges: end -->
## 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
```{r gh-installation, eval = FALSE}
# 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
- [A Short Introduction to the blorr Package](https://blorr.rsquaredacademy.com/articles/introduction.html)
## Usage
blorr uses consistent prefix `blr_*` for easy tab completion.
```{r libs}
library(blorr)
library(magrittr)
```
### Bivariate Analysis
```{r bivar}
blr_bivariate_analysis(hsb2, honcomp, female, prog, race, schtyp)
```
### Weight of Evidence & Information Value
```{r woeiv}
blr_woe_iv(hsb2, prog, honcomp)
```
### Model
```{r model}
# create model using glm
model <- glm(honcomp ~ female + read + science, data = hsb2,
family = binomial(link = 'logit'))
```
### Regression Output
```{r regress}
blr_regress(model)
```
### Model Fit Statistics
```{r mfs}
blr_model_fit_stats(model)
```
### Confusion Matrix
```{r conf}
blr_confusion_matrix(model)
```
### Hosmer Lemeshow Test
```{r hoslem}
blr_test_hosmer_lemeshow(model)
```
### Gains Table
```{r gains}
blr_gains_table(model)
```
### Lift Chart
```{r lift}
model %>%
blr_gains_table() %>%
plot()
```
### ROC Curve
```{r roc}
model %>%
blr_gains_table() %>%
blr_roc_curve()
```
### KS Chart
```{r kschart}
model %>%
blr_gains_table() %>%
blr_ks_chart()
```
### Lorenz Curve
```{r}
blr_lorenz_curve(model)
```
## Getting Help
If you encounter a bug, please file a minimal reproducible example using
[reprex](https://reprex.tidyverse.org/index.html) on github. For questions and
clarifications, use [StackOverflow](https://stackoverflow.com/).
## Code of Conduct
Please note that the blorr project is released with a [Contributor Code of Conduct](https://blorr.rsquaredacademy.com/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.