I've fit a series of mixed effect models with the lme4 package in R on a set of binomial outcome variables (1: the event happened, 2: it did not). The fixed effect specification is intercept only, and there are two additional random effects (also intercept). The family fit is binomial. The typical function is then:

glmer(dv ~ 1 + (1 |re1) + (1 |re2), family=binomial, data=data)

My overarching goal here is that I would like to use the model outputs to estimate the difference in the probability of an event occurring between the levels of re1 independent from the influence of re2.

In trying to address this question, one tutorial mentioned using the R function pnorm on the intercept estimate recovers the overall probability of the event, and indeed across all the models I fit, it does. So if the fixed model intercept is estimated to be -1.92, pnorm yields .027, which is the average of the dv across the whole sample.

pnorm, as I understand it, calculates the distribution function. But I'm having some trouble putting into words the connection between the model intercept, the pnorm function, and the mean of the dv.

I anticipate that this is something that only works with binomial distributions. How would I go about doing something similar, say, if I wanted to use the model intercept to estimate the average of a count dv, fit with a Poisson family.

Hope I've articulated this question well enough.

  • $\begingroup$ This shouldn't work. lmer uses a logit link by default. So you should have to use $\frac{e^b}{e^b+1}$ to get back to your overall probability of outcome (supposing $b$ is your intercept). If you had specified a probit link using family=binomial("probit") then this would work. To understand why look up 'link' functions $\endgroup$ – George Savva Mar 5 '20 at 11:10
  • $\begingroup$ Also, don't use lmer for binary outcomes use glmer. $\endgroup$ – George Savva Mar 5 '20 at 11:11
  • $\begingroup$ This is 100% correct. It was a mistake in my code, should have just slept on it. Thanks for your help! $\endgroup$ – larsonsm Mar 8 '20 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.