问题
I need to add 95% confidence intervals on my glm plot.
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?
This is what I have now:
plot(allEffects(fit1), ylab= "Age of onset of foraging", main="",
type="rescale", multiline=T, rescale.axis=F)
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
回答1:
From ?plot.eff
:
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.
Using an example from ?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")
来源:https://stackoverflow.com/questions/34472203/add-confidence-intervals-to-glm-alleffects-plot