Skip to content

Commit bede6fc

Browse files
Merge pull request #96 from rsquaredacademy/develop
remove coc and fix tests
2 parents a0d5a80 + 55a510e commit bede6fc

File tree

7 files changed

+35
-50
lines changed

7 files changed

+35
-50
lines changed

README.Rmd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,3 @@ If you encounter a bug, please file a minimal reproducible example using
137137
[reprex](https://reprex.tidyverse.org/index.html) on github. For questions and
138138
clarifications, use [StackOverflow](https://stackoverflow.com/).
139139

140-
## Code of Conduct
141-
142-
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
# blorr
55

6-
> Tools for building binary logistic regression
7-
models
6+
> Tools for building binary logistic regression models
87
98
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/blorr)](https://cran.r-project.org/package=blorr)
109
[![cran
@@ -289,9 +288,3 @@ If you encounter a bug, please file a minimal reproducible example using
289288
[reprex](https://reprex.tidyverse.org/index.html) on github. For
290289
questions and clarifications, use
291290
[StackOverflow](https://stackoverflow.com/).
292-
293-
## Code of Conduct
294-
295-
Please note that this project is released with a [Contributor Code of
296-
Conduct](CONDUCT.md). By participating in this project you agree to
297-
abide by its terms.

tests/testthat/test-bivariate-analysis.R

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,8 @@ test_that("blr_segment prints the correct output", {
5454
test_that("output from blr_twoway_segment is as expected", {
5555

5656
k <- blr_segment_twoway(hsb2, honcomp, prog, race)
57-
actual <-
58-
k %>%
59-
use_series(twoway_segment) %>%
60-
`[`(, 4) %>%
61-
round(2) %>%
62-
unname()
63-
expected <- c(0.04, 0.16, 0.02)
57+
actual <- unname(round(k$twoway_segment[, 4], 3))
58+
expected <- c(0.035, 0.165, 0.020)
6459
expect_equivalent(actual, expected)
6560
})
6661

@@ -155,78 +150,78 @@ test_that("output from blr_woe_iv_stats is as expected", {
155150

156151
x <- cat("Variable: prog
157152
158-
Weight of Evidence
153+
Weight of Evidence
159154
-------------------------------------------------------------------------
160-
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
155+
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
161156
-------------------------------------------------------------------------
162-
1 38 7 0.26 0.13 0.67 0.08
163-
2 65 40 0.44 0.75 -0.53 0.17
164-
3 44 6 0.30 0.11 0.97 0.18
157+
1 38 7 0.26 0.13 0.67 0.08
158+
2 65 40 0.44 0.75 -0.53 0.17
159+
3 44 6 0.30 0.11 0.97 0.18
165160
-------------------------------------------------------------------------
166161
167-
Information Value
162+
Information Value
168163
-----------------------------
169-
Variable Information Value
164+
Variable Information Value
170165
-----------------------------
171-
prog 0.4329
166+
prog 0.4329
172167
-----------------------------
173168
174169
175170
Variable: race
176171
177-
Weight of Evidence
172+
Weight of Evidence
178173
-------------------------------------------------------------------------
179-
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
174+
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
180175
-------------------------------------------------------------------------
181-
1 22 2 0.15 0.04 1.38 0.15
182-
2 6 5 0.04 0.09 -0.84 0.04
183-
3 18 2 0.12 0.04 1.18 0.10
184-
4 101 44 0.69 0.83 -0.19 0.03
176+
1 22 2 0.15 0.04 1.38 0.15
177+
2 6 5 0.04 0.09 -0.84 0.04
178+
3 18 2 0.12 0.04 1.18 0.10
179+
4 101 44 0.69 0.83 -0.19 0.03
185180
-------------------------------------------------------------------------
186181
187-
Information Value
182+
Information Value
188183
-----------------------------
189-
Variable Information Value
184+
Variable Information Value
190185
-----------------------------
191-
race 0.326
186+
race 0.326
192187
-----------------------------
193188
194189
195190
Variable: female
196191
197-
Weight of Evidence
192+
Weight of Evidence
198193
-------------------------------------------------------------------------
199-
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
194+
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
200195
-------------------------------------------------------------------------
201-
0 73 18 0.50 0.34 0.38 0.06
202-
1 74 35 0.50 0.66 -0.27 0.04
196+
0 73 18 0.50 0.34 0.38 0.06
197+
1 74 35 0.50 0.66 -0.27 0.04
203198
-------------------------------------------------------------------------
204199
205-
Information Value
200+
Information Value
206201
-----------------------------
207-
Variable Information Value
202+
Variable Information Value
208203
-----------------------------
209-
female 0.1023
204+
female 0.1023
210205
-----------------------------
211206
212207
213208
Variable: schtyp
214209
215-
Weight of Evidence
210+
Weight of Evidence
216211
------------------------------------------------------------------------
217-
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
212+
levels 0s_count 1s_count 0s_dist 1s_dist woe iv
218213
------------------------------------------------------------------------
219-
1 123 45 0.84 0.85 -0.01 0.00
220-
2 24 8 0.16 0.15 0.08 0.00
214+
1 123 45 0.84 0.85 -0.01 0.00
215+
2 24 8 0.16 0.15 0.08 0.00
221216
------------------------------------------------------------------------
222217
223-
Information Value
218+
Information Value
224219
-----------------------------
225-
Variable Information Value
220+
Variable Information Value
226221
-----------------------------
227-
schtyp 0.0012
222+
schtyp 0.0012
228223
-----------------------------")
229224

230225
expect_output(print(k), x)
231226

232-
})
227+
})

tools/README-kschart-1.png

-232 Bytes
Loading

tools/README-lift-1.png

0 Bytes
Loading

tools/README-roc-1.png

0 Bytes
Loading

tools/README-unnamed-chunk-2-1.png

0 Bytes
Loading

0 commit comments

Comments
 (0)