check_or | R Documentation |
Performs a series of tests to ensure that assumptions for logistic regression are met, with optional detailed feedback if any tests fail.
check_or(glm_model_results, confint_fast_estimate = FALSE, details = TRUE)
glm_model_results |
Results from a binomial Generalised Linear Model (GLM), as produced by |
confint_fast_estimate |
Boolean (default = |
details |
Boolean (default = |
Logical, TRUE
if all assumption tests pass, FALSE
if one or more tests fail
# Load the Titanic dataset
df <- datasets::Titanic |>
dplyr::as_tibble() |>
# convert aggregated counts to individual observations
dplyr::filter(n > 0) |>
tidyr::uncount(weights = n) |>
# convert character variables to factors
dplyr::mutate(dplyr::across(dplyr::where(is.character), as.factor))
# Perform logistic regression using `glm`
lr <- stats::glm(
data = df,
family = binomial,
formula = Survived ~ Class + Sex + Age
)
# Check the model for logistic regression assumption violations
check_or(lr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.