sjplot:如何指定因变量?
我有一个关于 sjPlot、plot_models 函数的简短问题。
我有这个代码:
fit1 <- lm(mpg ~ wt + cyl + disp + gear, data = mtcars)
fit2 <- update(fit1, . ~ . + hp)
fit3 <- update(fit2, . ~ . + am)
fit4 <- lm(hp ~ wt + cyl + disp + gear, data = mtcars)
fit5 <- update(fit4, . ~ . + hp)
fit6 <- update(fit5, . ~ . + am)
fit7 <- lm(cyl ~ wt + cyl + disp + gear, data = mtcars)
fit8 <- update(fit7, . ~ . + hp)
fit9 <- update(fit8, . ~ . + am)
plot_models(fit1, fit2, fit3, fit4, fit5, fit6, fit7, fit8, fit9,std.est = "std2")
生成这个:
如何将引用 MPG 的所有因变量编码为蓝色,引用 hp 的所有因变量编码为绿色,以及引用 cyl 的所有因变量为估计中的黄色 阴谋?那么标签应该相应更新吗?
I have a short question about the sjPlot, plot_models function.
I have this code:
fit1 <- lm(mpg ~ wt + cyl + disp + gear, data = mtcars)
fit2 <- update(fit1, . ~ . + hp)
fit3 <- update(fit2, . ~ . + am)
fit4 <- lm(hp ~ wt + cyl + disp + gear, data = mtcars)
fit5 <- update(fit4, . ~ . + hp)
fit6 <- update(fit5, . ~ . + am)
fit7 <- lm(cyl ~ wt + cyl + disp + gear, data = mtcars)
fit8 <- update(fit7, . ~ . + hp)
fit9 <- update(fit8, . ~ . + am)
plot_models(fit1, fit2, fit3, fit4, fit5, fit6, fit7, fit8, fit9,std.est = "std2")
Which generates this:
How can I code all dependent variables that refer to MPG as blue, all dependent variables that refer to hp as green, and all dependent variables that refer to cyl as yellow in the estimates plot? And then the label should update correspondingly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用GGPLOT命令来调整颜色:
如您所见,子类型之间的区别不是很好。
You can use ggplot commands to adjust the colors:
As you can see, the distinction between the subtypes is not very good.