knitr::opts_chunk$set(
  collapse = TRUE, message=FALSE, warning=FALSE,
  comment = "#>"
)

In this analysis, we'll develop a model for predicting births by caesarian from patient characteristics uing the caesarian data frame.

Model fitting is normally an iterative process. We'll skip this to keep things simple.

Fit the model

library(qacReg)
data(caesarian)

fit <- glm(caesarian ~ ., family = binomial, data = caesarian)

# or
# fit <- regress(caesarian ~ ., data = caesarian)

Examine the model

info(fit)

Perform regression diagnostics

diagnostics(fit)

Visualize the model parameters

forest_plot(fit)
me_plots(fit)

Evaluate variable importance

relimp(fit)

Assess predictive performance

performance(fit)

Additional output

ROC Plot

pred <- predict(fit, caesarian, type="response")
roc_plot(caesarian$caesarian, pred, positive="yes")

Lift and Gain Charts

lift_plot(caesarian$caesarian, pred, positive="yes")


Rkabacoff/qacReg documentation built on Aug. 1, 2022, 11:11 p.m.