easystats / modelbased

:chart_with_upwards_trend: Estimate effects, contrasts and means based on statistical models
https://easystats.github.io/modelbased/
GNU General Public License v3.0
234 stars 19 forks source link

Plot method for categorical focal predictors #199

Open strengejacke opened 2 years ago

strengejacke commented 2 years ago

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)

bwiernik commented 2 years ago

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()

strengejacke commented 2 years ago

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.

bwiernik commented 2 years ago

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

strengejacke commented 2 years ago

same as #145 ?