easystats / easystats/parameters
`modelsummary`'s `coef_rename` doesn't work with `avg_comparisons`
Open
@strengejacke is already working on this.
Since Jul 4, 2026.
3 investigators :grey_question::question:
Enhancement :boom:
- Dominant language
- R
- Stars
- 499
- Forks
- 45
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 3
Description
Consider the following example:
tmp <- mtcars
tmp %<>% mutate(across(cyl, as.factor))
tmp <- set_variable_labels(
tmp,
mpg = "Miles per gallon",
cyl = "Number of cylinders",
disp = "Displacement"
)
attr(tmp$am, "label")
mod <- lm(mpg ~ cyl + disp, tmp)
modelsummary(dvnames(mod), coef_rename=TRUE)
mod_ame <- avg_comparisons(mod, variables = list(cyl = "reference"))
modelsummary(dvnames(mod_ame), shape=term+contrast~model, coef_rename=TRUE)
which prints:
The labels are lost for both the dependent and the independent variable.
Reported here as per https://github.com/vincentarelbundock/modelsummary/issues/966#issuecomment-4866327066
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.
Assessment
This issue has not been assessed yet.