easystats / easystats/modelbased
plotting of predictions fails if no predictors (e.g., intercept only models)
Open
Nobody has claimed this yet.
What's your opinion :hear_no_evil:
- Dominant language
- R
- Stars
- 263
- Forks
- 22
- Avg merge
- 1h 22m
- Merged PRs (30d)
- 11
Description
m <- lm(qsec ~ 1, data = mtcars)
modelbased::estimate_prediction(m) |>
plot()
#> Error: No `by` variable was detected, so nothing to put in the x-axis.
Created on 2026-04-08 with reprex v2.1.1
Not sure what's the best solution here:
- Throw more informative error message
- Produce histogram / density plot (https://github.com/easystats/performance/issues/897) instead
- The plotting of predictions should always produce distribution plots
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 by reproducing the intercept-only lm(qsec ~ 1, data = mtcars) example and running modelbased::estimate_prediction(m) |> plot(). Read the prediction plotting path around the missing by variable and compare the proposed informative error, histogram/density plot, and distribution-plot behaviors. Done means selecting and implementing one agreed behavior with coverage for models without predictors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100