我想获得模型交互效果的预测(例如使用sjPlot::plot_model或ggeffects打包,然后将它们提供给 ggplot2 以可视化 ggplot2 中的交互。有人可以帮助编写代码来做到这一点吗?我的问题与堆栈上的其他问题不同,因为它首先使用标准包进行预测,然后绘制它们。
我当前的型号:
\nmodel <- glmmTMB(total_count ~ mean_temp*lwd_duration + (1|year), family = nbinom1, data=df)\n\nsummary(model)\n\nFamily: nbinom1 ( log )\nFormula: total_count ~ mean_temp * lwd_duration + (1 | year)\nData: df\n\n AIC BIC logLik deviance df.resid \n 260.6 270.7 -124.3 248.6 34 \n\nRandom effects:\n\nConditional model:\n Groups Name Variance Std.Dev. \n year (Intercept) 3.683e-09 6.069e-05\nNumber of obs: 40, groups: year, 4\n\nDispersion parameter for nbinom1 family (): 178 \n\nConditional model:\n Estimate Std. Error z value Pr(>|z|) …Run Code Online (Sandbox Code Playgroud)