[R-sig-ME] standard errors for predictions from lmer and/or glmm.admb

Rafael Mares crm53 at cam.ac.uk
Thu Jun 2 20:45:48 CEST 2011


Dear all

I'm trying to obtain the standard errors for predictions from two
different mixed effects models:

- a glmm using lmer (lme4 ver. 0.999375-39) with binomial errors
(binary response variable), both continuous and categorical
explanatory variables and two crossed random effects
- a glmm using glmm.admb (glmmADMB ver. 0.5-2) with negative binomial
errors (count response variable), both continuous and categorical
explanatory variables and one random effect

I'm not comparing the two models, but I'd like to find a way to obtain
the standard errors for the predictions (using new data sets) that
would be applicable to both the lmer and the glmm.admb models... not
necessarily applicable to both, but I think it would help me
understand what I'm doing. I've read some of the older posts on this
mailing list regarding prediction errors and intervals, but I'm either
not understanding them correctly or the methods aren't applicable to
neither lme4 nor glmmADMB.

So far, I am able to obtain predicted values using new data sets, for
both models, but I don't know how to get the standard errors. For the
predictions, I'm using:

for the lmer model:
	mm = model.matrix(terms(my.binomial.model),new.data1)
	predictions = mm %*% fixef(my.binomial.model)	# not transformed to
the original scale
	
for the glmm.admb model:
	mm = model.matrix(my.negbinom.model$fixed,new.data2)
	predictions = mm%*%my.negbinom.model$b	# not transformed to the original scale
	
Thank you in advance for any help. I've copied the model calls and
parts of the outputs below, in case that helps.

All the best,

Raff



my.binomial.model <-
lmer(ryn~age+I(age^2)+resmw+I(resmw^2)+popevicted+igiyn+rainmo+(1|id)+(1|grpyr),REML=TRUE,family=binomial(link="logit"),data=dat)

AIC		BIC		logLik	deviance
10407	10484	-5194	10387

Random effects:
Groups Name		Variance	Std.Dev.
id     (Intercept)	        0.54015	0.73495
grpyr  (Intercept)	1.16213 	1.07802
Number of obs: 16658, groups: id, 376; grpyr, 114

Fixed effects:
			Estimate Std. Error 	z value 	Pr(>|z|)
(Intercept)	       -2.42098	0.12856	-18.832	< 2e-16 ***
age			2.06563	0.09308	22.193	< 2e-16 ***
I(age^2)		-0.57197	0.10857	-5.268	1.38e-07 ***
resmw		1.39434	0.10297	13.542 	< 2e-16 ***
I(resmw^2)	-0.37143	0.11434	-3.249  	0.00116 **
popevicted	         0.56668	0.05780	9.804  	< 2e-16 ***
igiynY		1.24795	0.06412	19.462 	< 2e-16 ***
rainmo		-1.45658	0.07230	-20.146  	< 2e-16 ***



my.negbinom.model <-
glmm.admb(dur~age+partners+igic+bsit+rainmo+dmcat,random=~1,group="id",data=dat,family="nbinom",easyFlag=FALSE)

Coefficients:
            		Estimate 	Std. Error 	z value 	Pr(>|z|)
(Intercept)   	0.0695      0.0874    0.80  	0.42619
age           	0.2906      0.0759    3.83  	0.00013 ***
partners     	-0.1961   	 0.0850   -2.31  	0.02104 *
igicB        		-0.2023     0.0913   -2.21 	0.02677 *
igicC        		-0.4857     0.0957   -5.07  	3.9e-07 ***
bsit         		-0.6567     0.0799   -8.22  	< 2e-16 ***
rainmo       	0.1468      0.0645    2.28  	0.02271 *
dmcatNI       	0.3008      0.1095    2.75  	0.00600 **
dmcatNN       	0.0213      0.1108    0.19  	0.84767

2833 total observations; 230 groups (id)
Random effect variance (id): 0.24722 (std. err.: 0.050587)
Negative binomial alpha: 0.72194 (std. err.: 0.72194)

Log-likelihood: -3724.37
AIC: 7472.74



--
Rafael Mares
Large Animal Research Group (LARG)
Department of Zoology
University of Cambridge
Downing Street
Cambridge
CB2 3EJ




More information about the R-sig-mixed-models mailing list