R语言疑难杂症,plot与alleffects结合使用时,multiline=T置信区间消失

有多条拟合曲线时

当使用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")

完事大吉

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值