Vote count:
0
I'm working with mixed-effect logistic regression models using a single random variable(using glmer), and I am struggling to find a way to produce predicted probabilities and the respective 95% CI's. I have been able to do this for fixed-effect models using the following type of code:
Call:
glm(formula = survive/trials ~ class, family = binomial(logexp(vespdata$expos)),
data = vespdata)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.6823 0.2621 0.4028 0.4540 0.6935
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.6774 0.5796 8.069 7.07e-16 ***
class2 -1.3236 0.6957 -1.903 0.0571 .
class3 -0.5751 0.9170 -0.627 0.5306
class4 -1.0806 0.9217 -1.172 0.2411
class5 -1.2889 0.6564 -1.964 0.0496 *
class6 -1.5379 0.6508 -2.363 0.0181 *
class8 -1.2078 0.6957 -1.736 0.0825 .
vesppredict2 = with(vespdata, data.frame(class = gl(7,1))
vesppredict2 = cbind(vesppredict2, predict(vespclass.exp, newdata = vesppredict2,
type = "link", se = TRUE))
vesppredict2 = within(vesppredict2,
{PredictedProb = (plogis(fit))^23
LL = (plogis(fit - (1.96 * se.fit)))^23
UL = (plogis(fit + (1.96 * se.fit)))^23
ErrorBar = (UL-PredictedProb)
})
The problem I'm having is that predict() cannot use the argument se = TRUE for mixed-effect models. I tried adding the argument re.form = NA but to no avail. I'd be grateful for any tips!
asked 47 secs ago
Confidence intervals for predicted probabilities in mixed-effect regression?
Aucun commentaire:
Enregistrer un commentaire