有多条拟合曲线时
当使用plot(allEffects(lm),multiline=F)时,置信区间\误差区间显示正常
当plot(allEffects(lm),multiline=T),置信区间\误差区间消失
参考https://stackoverflow.com/questions/34472203/add-confidence-intervals-to-glm-alleffects-plot
其中提到
ci.style: confidence bounds can be indicated using error bars, using lines or confidence bands, depending on the plot type. ... For multiline plots, the default is ‘"none"’ for no confidence bounds, but style ‘"bars"’ or ‘"bands"’ can also be used.
也就是说,在multiline=T时,ci.style默认为none,没有置信区间
当修改ci.style为bars\bands时,置信区间可以使用
修改语句为
plot(allEffects(lm),multiline=T,ci.style="bars")
置信区间显示
输入?plot.eff
深入阅读之后
其中对于ci.style有这样的介绍
confint
specifications to add/remove confidence intervals or regions from a plot, and to set the nominal confidence level.
style
one of
"auto"
,"bars"
,"lines"
,"bands"
, and"none"
; the default is"bars"
for factors,"bands"
for numeric predictors, and"none"
for multiline plots;"auto"
also produces"bars"
for factors and"bands"
for numeric predictors, even in multiline plots.
alpha
transparency of confidence bands; the default is 0.15.
col
colors; the default is taken from the line colors.
bars用于factors,bands用于numeric predictors,
简单的来说
改为
plot(allEffects(lm),multiline=T,ci.style="auto")
完事大吉