easystats / easystats/modelbased

plotting of predictions fails if no predictors (e.g., intercept only models)

Open
#609 3 comments 0 reactions 0 assignees View on GitHub

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.