FAQ
Dear R-users,
I'm using lmer to fit two-level logistic models and I'm interested in
predicted probabilities that I get in this way (using "fitted"):

glm1 = lmer(XY\$T1~X1 + X2 + X3 + (1|Cind), family=binomial) #estimation of a
two-level logit model

fit1=fitted(glm1) # I get the fitted linear predictor

ilog = function(x) { 1/(1 + exp(-x)) }

ps1=ilog(fit1) # In order to get the estimated probabilities

Is this procedure correct? In this way I'm getting the "conditional
probabilities", right? Is there any function I can use in order to get the
"empirical bayes (EB) probabilities"? Any suggestion?
And more generally, can you suggest me any paper/textbook/notes clarifying
when it's more suitable to use one kind of probability than the other?

Here are the formulas for what I labelled as conditional and EB probability:

The model is: logit(P(Y=1)) = a + bX + u

conditional: P(Y=1/u=u^) = 1/(1 + exp(-(a^ + b^X + u^)))

EB: ?[1/(1 + exp(-(a^ + b^X + u)))] x Posterior (u/Y, X) du

(u is the random effect; ^ indicates estimated)

Many thanks

--
View this message in context: http://www.nabble.com/How-to-predict-probabilities-after-using-lmer-tp20678825p20678825.html
Sent from the R help mailing list archive at Nabble.com.

## Related Discussions

 view thread | post posts ‹ prev | 1 of 1 | next ›
Discussion Overview
 group r-help categories r posted Nov 25, '08 at 10:46a active Nov 25, '08 at 10:46a posts 1 users 1 website r-project.org irc #r

### 1 user in discussion

Content

People

Support

Translate

site design / logo © 2022 Grokbase