[R-sig-ME] multivariate mixed nested model

Thierry Onkelinx thierry.onkelinx at inbo.be
Mon Jan 30 16:02:10 CET 2017

Dear Claudio,

I this you need to add the interaction with traits to all the fixed and
random effects. Otherwise you assume that these have the same effect for
each trait. Note that 0 + traits is identical to traits - 1.

mumo1 <- lmer(value~0 + traits + traits:species + (0 +
traits|species:populations) + (0 + traits|individuals), mdata, REML=FALSE)

Your second question needs a reproducible example.

Best regards,

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2017-01-28 16:43 GMT+01:00 Claudio <oppela op gmail.com>:

> Hi all.
> I collected six body features (bf1-bf6)from three populations of a
> salamander and from two populations of another sister species of
> salamander.
> I would evaluate how the species (fixed) and population belonging
> (random) affect the body features, by comparing models built with lme4.
> For some models, I also want to include bf6 as covariate. Thus, in case
> of univariate analyses, some models, for example, could be:
> mo1<-lmer(bf1~species+(1|species:population), data, REML=FALSE)
> mo2<-lmer(bf1~species+bf6+(1|species:population), data, REML=FALSE)
> However, I want to fit multivariate models, and my post is about this.
> First, I melted the data:
> mdata<-melt(data, id.vars = c("species", "population", "bf6"),
> measure.vars = c("bf1", "bf2","bf3","bf4","bf5"), variable.name =
> "traits)
> Now the question.
> 1) Are the multivariate versions of the models mo1 and mo2 above
> mumo1<-lmer(value~traits -1 + species + (1|species:populations) +
> (1|individuals), mdata, REML=FALSE)
> mumo1<-lmer(value~traits -1 + species + bf6 + (1|species:populations) +
> (1|individuals), mdata, REML=FALSE)
> A secondary question, which in case I will move to a new post:
> it seemed to me that building multivariate models with MCMCglmm is
> easier. However, cbind did not work, even without missing values: to
> your knowledge, is there any issue?
> thanks in advance
> Claudio
> _______________________________________________
> R-sig-mixed-models op r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

	[[alternative HTML version deleted]]

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