Skip to content

check_model() linearity & variance for categorical predictors #873

@DominiqueMakowski

Description

@DominiqueMakowski

For models with a categorical predictor (3 levels here):

star <- read.csv("https://drmankin.github.io/disc_stats/star.csv") |>
  dplyr::mutate(dplyr::across(dplyr::starts_with("star"), forcats::as_factor))

star_maths_lm <- lm(math2 ~ star2, data = star, na.action = na.exclude)

performance::check_model(star_maths_lm)
Image
plot(star_maths_lm, which = 1)
Image

The variance and linearity plots could arguably be more informative. In particular the one to compare the variance across the different groups.

In a way the very large CI masks the variability in the data points. But I'm not s ure what's the best way to adress it:

  • Add an option to simply drop the CI ribbon?
  • Have bespoke plots for categorical predictors?
  • Alternatives?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions