【发布时间】:2016-09-16 13:49:37
【问题描述】:
我有我的拟合模型,想通过 R (v.3.3.1) 中的“效果”包绘制效果。到目前为止,一切正常。
dipt.moi <- lmer(log_dipt ~ stemp + shum + swind + scc + ct + mt + (1|plot)
#Plotting:
library(effects)
plot(allEffects(dipt.moi)[1])
#or:
plot(Effect(focal.predictors = "stemp", dipt.moi)
但是当我查看我的绘图时,我注意到 x 轴并未涵盖我数据的所有范围。它只是在边缘“切断”了一些数据。 奇怪的是,这并不适用于我所有的情节,只适用于一些情节,我无法在这里发现特定的模式。
请注意,我在 stemp 上的实际数据范围是 -2.1 到 2.9
我试图调整:
plot(Effect(focal.predictors = "stemp", dipt.moi),xlevels=c(-2.1,2.9))
#and
dlist<-list(L$stemp)
plot(Effect(focal.predictors = "stemp", dipt.moi),xlevels=list(dlist))
情节已绘制,但不会有任何改变。
这个问题在其他论坛上也有人问过(https://stat.ethz.ch/pipermail/r-help/2014-February/366237.html),但我用 xlevels 命令(如上)、xlim 命令尝试过,但没有成功。
有人知道如何在这里调整 x 轴吗?也许这根本不可能?!
问候,卢卡斯。
【问题讨论】:
-
您应该向reproducible example 提供示例数据和用于制作绘图的代码。这样可以更轻松地为您提供帮助。
-
更新了,希望现在更容易理解。感谢您的提示。
标签: r plot statistics