Data for generating Lorenz curve.

blr_prep_lorenz_data(model, data = NULL, test_data = FALSE)

Arguments

model

An object of class glm.

data

A tibble or data.frame.

test_data

Logical; TRUE if data is test data and FALSE if training data.

Examples

model <- glm(honcomp ~ female + read + science, data = hsb2, family = binomial(link = 'logit')) data <- model$data blr_prep_lorenz_data(model, data, FALSE)
#> # A tibble: 12 x 2 #> cum_0s_per cum_1s_per #> <dbl> <dbl> #> 1 0 0 #> 2 0.0408 0.264 #> 3 0.0884 0.509 #> 4 0.156 0.698 #> 5 0.245 0.830 #> 6 0.361 0.887 #> 7 0.476 0.943 #> 8 0.605 0.962 #> 9 0.728 1 #> 10 0.864 1 #> 11 1 1 #> 12 1 1