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
232 stars 19 forks source link

`visualization_recipe()` for `estimate_slopes()` should not map alpha to discrete values #239

Open strengejacke opened 8 months ago

strengejacke commented 8 months ago

Related to https://github.com/easystats/see/pull/310 visualization_recipe() adds the alpha-aes, but it's mapped to a discrete scale, which yields a warning (and thus, some tests fail for see).

model <- lm(Petal.Length ~ Species * poly(Sepal.Width, 3), data = iris)
result <- modelbased::estimate_slopes(model, at = c("Sepal.Width", "Species"))
#> No numeric variable was specified for slope estimation. Selecting `trend = "Sepal.Width"`.
plot(result)
#> Warning: Using alpha for a discrete variable is not advised.

Created on 2023-10-12 with reprex v2.0.2

bwiernik commented 8 months ago

In general, we should avoid using alpha as an aesthetic. linetype would be better here

DominiqueMakowski commented 8 months ago

In this specific case, I like having the significant chunks on alpha... Is there a way to avoid the warning?

bwiernik commented 8 months ago

I really strongly think we should not map things to alpha. It is very inaccessible. We should use color, linewidth, or linetype instead

When I was teaching, students almost always assumed that something was broken or wrong when they got a plot using alpha mapping — it’s not an aesthetic people expect to see in the situations where we use it

DominiqueMakowski commented 8 months ago

I supposed the alternative would be dashed for non-sig and solid for sig whaddayathink?

bwiernik commented 8 months ago

I would like that a lot