knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
devtools::load_all()

Post estimation for GLMs in R

R-build-check Coverage status

After fitting a logistic model in R using glm, getting classification rates, ROC curves and AUCs are non-trivial - they're 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)
pr_sensitivity(m, threshold = .4)
pr_AUC(m)
pr_ROC(m)


josherrickson/postr documentation built on Nov. 13, 2020, 11:23 a.m.