[R-sig-ME] FW: Prediction of random effects - logist mixed model
Correa S.T.
scorrea at soton.ac.uk
Wed May 14 13:03:51 CEST 2008
Dear list,
I am working with a two-level logistic mixed model and I am interested
in predicting the random effects for a given value of the parameters
(not for the estimates obtained from the data at hand, which can be
obtaiend using fucntion 'ranef'). For illustration, please see the code
below.
# mixed logistic model
fit1.b<-lmer(yij.b.true ~ x1 + x2 + (1|area), family =
binomial(link=logit), data=bootsamp
,control=list(usePQL=FALSE),verbose=FALSE,method="Laplace")
# estimates of the parameter based on the data at hand
beta.hat<-fixef(fit1.b)
varu.hat<-as.numeric(VarCorr(fit1.b)[[1]][1,1])
# predicting group effects based on the data at hand
u.pred<-ranef(fit1.b)[[1]
==>> I would like to obtain u.pred2 such that u.pred2=g(beta, varu) for
any given beta and
varu. In other words, I need to extract the function g() used in the
lmer to predict the u random effects. Is there a way to do that?
Thank you very much.
Solange Correa,
Ph.D. student
Social Statistics
University of Southampton, UK.
************* ********************************
summary of the model fitting
**********************************************
> fit1.b
Generalized linear mixed model fit using Laplace
Formula: yij.b.true ~ x1 + x2 + (1 | area)
Data: bootsamp
Family: binomial(logit link)
AIC BIC logLik deviance
299.1 315.5 -145.5 291.1
Random effects:
Groups Name Variance Std.Dev.
area (Intercept) 0.33441 0.57828
number of obs: 450, groups: area, 30
Estimated scale (compare to 1 ) 0.9462897
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.33328 0.86467 -2.698 0.00697 **
x1 0.36417 0.31776 1.146 0.25178
x2 0.15127 0.03137 4.821 1.43e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) x1
x1 -0.125
x2 -0.960 -0.050
More information about the R-sig-mixed-models
mailing list