[R-sig-ME] bivariate response mixed model using lme4 and residual (co)variances

Ned Dochtermann ned.dochtermann at gmail.com
Tue Sep 20 23:35:48 CEST 2011


All,

I am attempting to "cheat" with lme4 to calculate the correlation between
two traits--y & z--measured repeatedly (simulation data actually) for
individuals by use of dummy variables. I can calculate the
between-individual variances and covariances with the data structured as:

ind	y_rand		z_rand		yz
A	1		0		-1.941248639
A	1		0		0.747675528
B	1		0		2.502358777
B	1		0		2.752530485
...
A	0		1		-2.770832751
A	0		1		1.503659962
B	0		1		2.341289276
B	0		1		0.086881723

and then fitting the following model:

yz.mm<-lmer(yz~-1+y_rand+z_rand+(y_rand+z_rand-1|ind),data=ind.data)

This gives seemingly correct results (i.e. consistent with results from
MCMCglmm and ASReml) for the between-individual estimates. The issue that
I'm running into is that since I'm treating y and z as the same variable, I
can't figure out how to get any sort of within-individual estimates beyond a
single variance estimate. This makes sense given the way I've formulated the
model. 

Is there any way to likewise cheat to get within-individual/group variance
and covariance estimates with lme4? I can get what I need from MCMCglmm but,
for computational reasons I'd prefer lme4. 

Thanks for any help,
Ned

p.s. just realized that I can probably get what I want from lme...

--
Ned Dochtermann
Department of Biology
University of Nevada, Reno

ned.dochtermann at gmail.com
http://wolfweb.unr.edu/homepage/mpeacock/Ned.Dochtermann/
http://www.researcherid.com/rid/A-7146-2010
--




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