# Why does using the pnorm function on the intercept estimate of a binomial regression recover the mean of the dependent variable?

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:

lmer(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; thank you in advance.

• 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 – George Savva Mar 5 at 11:10
• Also, don't use lmer for binary outcomes use glmer. – George Savva Mar 5 at 11:11
• This is 100% correct. It was a mistake in my code, should have just slept on it. Thanks for your help! – larsonsm Mar 8 at 19:31