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)
The labels are lost for both the dependent and the independent variable.
Consider the following example:
which prints:
The labels are lost for both the dependent and the independent variable.
Reported here as per vincentarelbundock/modelsummary#966 (comment)