0
$\begingroup$

I am using PROC GLIMMIX to run a multi-level logistic regression model that contains a random intercept. I am outputting the predicted probabilities for each individual in my dataset, and then I am taking the average of these probabilities to get my average predicted probability over the entirety of the data.

My average predicted probability should equal $$ \text{p} = exp(\pi)/(1+exp(\pi))\\ $$

However, I am getting slightly different answers. For instance, when I output the predicted probabilities in GLIMMIX I get

$$ p=.0482359 $$

When I output the linear predictor I get $$ \pi=-3.1041776 $$

and $$ exp(-3.1041776)/(1+exp(-3.1041776))=.0429352616\\ $$

I don't know why I am not getting p=.0482359 for the last equation.

Does anyone know why this is?

Thanks.

$\endgroup$
  • $\begingroup$ Could you explain why you think your first formula is correct? Where did it come from? $\endgroup$ – whuber Apr 28 '16 at 16:48
  • $\begingroup$ I'm just using the logit link function, where $$\pi=\beta_0+...\beta_p\\$$ $\endgroup$ – bada bing Apr 28 '16 at 16:59
  • $\begingroup$ But what does that have to do with average predicted probabilities? $\endgroup$ – whuber Apr 28 '16 at 18:35
1
$\begingroup$

It's Jensen's inequality: the average of the logit is not the logit of the average.

The correct method is to average the individual predicted probabilities since the logit function is noncollapsible.

$\endgroup$
  • $\begingroup$ Thanks, Adam. So given the two options, it is 'more correct' to have GLIMMIX first transform to probabilities, and then average those probabilities? Instead of averaging the linear predictors, and then taking $$\text{exp}(\pi)/(1+\text{exp}(\pi))\\$$? Why do you think this is the better option? $\endgroup$ – bada bing Apr 28 '16 at 17:05
  • $\begingroup$ @badabing yes, in a mixed model setting, the S shaped curve of risk belongs to each individual, and the population averaged curve does not fit that functional form. It is something very complicated, a convolution of logits, but you need not calculate it. $\endgroup$ – AdamO Apr 28 '16 at 17:07
  • $\begingroup$ Thanks a bunch Adam. I was initially doing the opposite of what you said - I'll flip this around. $\endgroup$ – bada bing Apr 28 '16 at 17:16

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.