没有找到任何直接通过
plot_model
。但一种选择是操纵
ggplot
对象。为此,您首先必须计算
hline
和
text
层。然后设置
size
直接通过
aes_params
要素
由于您没有提供示例数据,我使用的默认示例之一来自
?lme4::glmer
:
library(lme4)
#> Loading required package: Matrix
library(ggplot2)
library(sjPlot)
# Run the model
plotModel <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
data = cbpp, family = binomial
)
# Plot the results
set_theme(base = theme_light())
state1plot <- plot_model(plotModel,
show.values = TRUE, show.p = FALSE,
value.offset = 0.3, title = "",
axis.labels = c(
"Xeric Shrubs", "Xeric Grasses", "Water", "Mesic Shrubs",
"Mesic Grasses", "Developed", "Deciduous Tree Canopy",
"Conifer Tree Canopy", "Bare Ground"
), axis.lim = c(0.01, 20), colors = c("#C43302", "#EDAA25"),
vline.color = "#061423", dot.size = 8, line.size = 1
) +
theme(text = element_text(size = 20))
# vline
state1plot$layers[[1]]$aes_params$size <- 4
# labels
state1plot$layers[[4]]$aes_params$size <- 8
state1plot