[R-sig-ME] Multivariate mixed models

David Atkins datkins at u.washington.edu
Wed Oct 3 13:09:19 CEST 2012


Hi Fiona--

It is certainly possible to fit *some* multivariate mixed models using 
(g)lmer.  The major limitation that I am aware of is that you need to 
assume a common residual error term (though, this could be relaxed using 
lme() in the nlme package).

If I understand your model below:

 > model <- lmer (trait.score ~ 1 + (trait.id|family) + 
(individual|family) )
 >
 > but this model makes R crash and so I'm assuming there might be some
 > kind of convergence problem?! And I'm not even sure this model would
 > give me the genetic covariances between traits, it would probably
 > just give the genetic variances for each trait (as before but in one
 > model instead of 3 separately)?

I might try the following:

mult.lmer <- lmer (trait.score ~ -1 + traid.id + (-1 + trait.id | 
family), data = mydf)

This will fit mean levels of your 3 traits as fixed-effects along with 
variances (and covariances) among them over families (as random-effects).

If that doesn't work, you might try including a reproducible example.

cheers, Dave

[Begin forwarded msg]
Hi,

The model cannot be fitted in lmer because a multivariate error
structure cannot be fitted.  You can do it in asreml-R which I believe
is now free to academic users on windows.

Cheers,

Jarrod


Quoting "Ingleby, Fiona" <fci201 at exeter.ac.uk> on Sat, 22 Sep 2012
14:10:13 +0000:

 > Hi everyone,
 >
 > I have a dataset with 3 trait measurements for individuals from
 > different families, like this:
 >
 > trait1      trait2      trait3      family
 >  0.5        -0.2         0.2         A
 >  0.2         0.7        -0.1         A
 >  0.3        -0.3         0.5         A
 >  0.1        -0.1         0.4         B
 > -0.4         0.5        -0.6         B
 > -0.1         0.8         0            B
 > -0.2         0.7         0.5         C
 >
 > ...and so on (there are 80 families with 20 individuals measured from 
each).
 >
 > The model I want to fit is pretty straightforward, with the three
 > traits as a multivariate response, and family as a random effect. I
 > want to be able to extract the genetic variance-covariance matrix
 > for the set of 3 traits. I can do this quite easily with MCMCglmm,
 > and am aware of non-Bayesian methods in other programs (i.e. SAS),
 > but awkwardly, I want to fit a non-Bayesian model in R.
 >
 > I can run individual lmer models for each trait, e.g.:
 >
 > model <- lmer (trait1 ~ 1 + (1|family) )
 >
 > and extract the random effects variance for the family term, giving
 > me the genetic variance for each trait from each model individually.
 > But this doesn't allow me to model the genetic covariance between
 > traits, and so I'm wondering if there is a way to run lmer with a
 > multivariate response, or if there is another method I could use to
 > fit this kind of model?
 >
 > I did try re-arranging my dataset so that the 3 trait scores for
 > each individual were stacked into one variable (creating new
 > variables for trait.id (1, 2, or 3) and individual id within family)
 > like this:
 >
 > trait.score     trait.id     individual     family
 >
 > and then the model:
 >
 > model <- lmer (trait.score ~ 1 + (trait.id|family) + 
(individual|family) )
 >
 > but this model makes R crash and so I'm assuming there might be some
 > kind of convergence problem?! And I'm not even sure this model would
 > give me the genetic covariances between traits, it would probably
 > just give the genetic variances for each trait (as before but in one
 > model instead of 3 separately)?
 >
 > Any ideas/advice would be greatly appreciated.
 >
 > Thanks,
 >
 > Fiona Ingleby
 >
 > _______________________________________________
 > R-sig-mixed-models at r-project.org mailing list
 > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
 >
 >



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


-- 
Dave Atkins, PhD
University of Washington
datkins at u.washington.edu
http://depts.washington.edu/cshrb/

August 1 - October 30:

Universitat Zurich
Psychologisches Institut
Klinische Psychologie
Binzmuhlestrasse 14/23
CH-8050 Zurich

+41 44 635 71 75



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