I have a lme4
model I have run for a hierarchical logistic regression, and I'm plotting the effects using the effects
package. I would like to create an effects graph with the standard error of the mean as the error bars. I can get the point estimates, 95% confidence intervals, and standard errors into a dataframe. The standard errors, however, seem at odds with the confidence limit parameters, see below for an example in a regular glm.
library(effects)
library(dplyr)
mtcars <- mtcars %>%
mutate(vs = factor(vs))
glm1 <- glm(am ~ vs, mtcars, family = "binomial")
(glm1_eff <- Effect("vs", glm1) %>%
as.data.frame())
vs fit se lower upper
1 0 0.3333333 0.4999999 0.1580074 0.5712210
2 1 0.5000000 0.5345225 0.2596776 0.7403224
My understanding is that the fit column displays the point estimate for the probability of am
is equal to 1 and that lower
and upper
correspond to the 95% confidence intervals for the probability that am
equals 1. Note that the standard error does not seem to correspond to the confidence interval (e.g., .33+.49 > .57).
Here's what I am shooting for. As opposed to a 95% confidence interval, I would like to have an effects plot with +- the standard error of the mean.
Are the standard errors in log-odds instead of probability? Is there a simply way to convert them to probabilities and plot them so that I can make the graph?
lme4
package figures into this? (I do not see any "hierarchy.) – IRTFMmaintainer("effects")
. (he's not necessarily the author.) I think the default for a 95% CI should beest +/- 1.96 * se
. If it's something else, there should be an explanation. I don't see any such explanation. Looks like a brain-fart occurred during construction of theas.data.frame.eff
-function. It's probably not a very commonly used function. – IRTFM