easystats / easystats/modelbased
Prediction plots for logistic models: improvements
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 263
- Forks
- 22
- Avg merge
- 1h 22m
- Merged PRs (30d)
- 11
Description
The current default plot for logistic models is like that:
p <- plot(modelbased::estimate_relation(glm(vs ~ mpg, data = mtcars, family = "binomial")))
p

However, when the outcome variable is not on the 0-1 scale, but is a factor (and thus 1-2 by default), the plot is messed up:
p <- plot(modelbased::estimate_relation(glm(sex ~ body_mass_g, data = palmerpenguins::penguins, family = "binomial")))
p

Created on 2021-06-09 by the reprex package (v1.0.0)
What would be the most elegant solution to plot the line on the outcome's scale?
On a related note, I'm thinking about moving from a pseudo-rug geoms for data points towards maybe something that would look like this:

What's the best way to create something like that? Using ggdists?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the estimate_relation() and plot() examples in the issue, comparing the 0–1 logistic outcome with the factor outcome shown in the linked images. Review the referenced barelysignificant.com example and the question about ggdists; done should define an agreed approach for plotting the line on the outcome scale and replacing the pseudo-rug presentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100