R package for postestimation on GLM models
CC0-1.0 License
After fitting a logistic model in R using glm
, getting classification
rates, ROC curves and AUCs are non-trivial - theyre easy to do, but
require coding manually every time.
The postr
package simplifies this.
data(mtcars)
m <- glm(vs ~ gear + mpg, data = mtcars, family = binomial)
All functions are prefaced by postr_
(aliased with pr_
) to simplify
the names without worrying about conflicts with other packages. For
example,
postr_classificationtable(m, threshold = .4)
#> Classified
#> Observed 0 1
#> 0 13 5
#> 1 3 11
pr_sensitivity(m, threshold = .4)
#> [1] 0.7857143
pr_AUC(m)
#> [1] 0.9246032
pr_ROC(m)