将置信区间添加到GLM allEffects图 [英] Add confidence intervals to GLM allEffects plot

查看:141
本文介绍了将置信区间添加到GLM allEffects图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的glm图上添加95%的置信区间.

I need to add 95% confidence intervals on my glm plot.

当我执行multiline=T时(因为我在同一块图上需要进行两次处理,所以我这样做了),间隔消失了.我该如何找回他们?

When I do multiline=T (because I need my 2 treatments on the same plot, so I did this), the intervals disappear. How can I get them back?

这就是我现在拥有的:

plot(allEffects(fit1), ylab= "Age of onset of foraging", main="",
     type="rescale", multiline=T, rescale.axis=F)

我拥有的数据-RFID是识别蜜蜂并跟踪蜜蜂运动的技术; 2种治疗:对照和病原体治疗; "first.trip"-直到第一次觅食之旅为止的天数.这是第一次旅行,我需要在allEffectsplot上获得95%的置信区间.

as data I have -RFID is the technique to identify the honeybees and follow their movements; 2 treatments: control and a pathogen-treatment; "first.trip" - days until their first foraging trip. This (first/trip) is am intersted in and for which I need the 95% confidence intervals on my allEffectsplot..

RFID = 01 0c 1d 1e 1f
colony = A  A  A  B  B
treatment = control DWV control control DWV  
first.trip = 19 NA NA 17 17 17
last.trip = 22  NA NA 17 31 30

推荐答案

来自?plot.eff:

ci.style:可以使用误差线, 线或置信带,取决于情节类型. ...对于多线图,默认为 无"无置信范围,但样式为酒吧"或 也可以使用乐队".

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.

使用?plot.eff中的示例:

library(effects)
mod.cowles <- glm(volunteer ~ sex + neuroticism*extraversion,
         data=Cowles, family=binomial)
eff.cowles <- allEffects(mod.cowles, xlevels=list(extraversion=seq(0, 24, 6)),
         given.values=c(sexmale=0.5))
plot(eff.cowles, 'neuroticism:extraversion',multiline=TRUE,
     ci.style="band")

这篇关于将置信区间添加到GLM allEffects图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆