modelbased icon indicating copy to clipboard operation
modelbased copied to clipboard

Plot method for categorical focal predictors

Open strengejacke opened this issue 3 years ago • 4 comments

First, it's difficult to see the point estimate, and second, this plot shows no confidence intervals?

m <- lm(Sepal.Width ~ Petal.Length + Petal.Width + Species, data = iris)
modelbased::estimate_expectation(m, insight::get_datagrid(iris, "Species")) |> plot()

Created on 2022-08-11 by the reprex package (v2.0.1)

strengejacke avatar Aug 11 '22 07:08 strengejacke

There's no error band because the x variable is discrete. With a discrete focal variable, we should make a recipe like that for estimate_means()

bwiernik avatar Aug 11 '22 12:08 bwiernik

Yes, yes, I know (that's why I added "categorical" in the title), I just wanted to keep this issue in mind, because we have CIs for the predictions, we just don't plot them.

strengejacke avatar Aug 11 '22 12:08 strengejacke

Yep, this is a bug that has bothered me for a while lol

bwiernik avatar Aug 11 '22 13:08 bwiernik

same as #145 ?

strengejacke avatar Aug 15 '22 06:08 strengejacke