我正在尝试使用sjPlot绘制包含多个交互项的回归系数。我更改了所有变量的标签,以使它们更易于理解,但是不幸的是,交互仅显示为variable_1:variable_2。
是否有一种方法可以修改这些交互的输出,使其显示为“ label_1 x label_2”或类似的效果?
这是一个例子:
data(mtcars)
library(ggplot2)
library(sjPlot)
library(sjlabelled)
library(dplyr)
mtcars <- mtcars %>% var_labels(
mpg = "Miles per Gallon",
cyl = "Cylinder"
)
x <- lm(hp ~ mpg*cyl, data=mtcars)
plot_model(x)