[R-sig-ME] coding multivariate + multiple membership in MCMCglmm
Jarrod Hadfield
j.hadfield at ed.ac.uk
Wed Oct 12 17:50:46 CEST 2011
Hi Alex,
I'm not entirely sure exactly what you would like the model structure
to look like. Currently you have (for the multimembership bit)
C[i,j] = U[id1[i], j]+U[id2[i], j]
where C is the nx4 response indexed by i (units) and j (trait).
U is a mx4 matrix where m is the number of individuals indexed by id1
or id2.
Currently you assume all elements of U have the same variance, which
is estimated.
If it helps you can look at the design matrix:
Z<-model.matrix(~mult.memb(~trait:id1+trait:id2), data=your_data)
Cheers,
Jarrod
On 12 Oct 2011, at 15:14, Alexandre Courtiol wrote:
> Dear all,
> I am trying to fit, using MCMCglmm a multivariate mixed model
> (gaussian)
> with an underlying multiple membership structure and I am not
> certain about
> my code...
> Background: I have raters (N~200) who came from different origins
> (A,B,C)
> and having different sexes (M,F), they ranked 4 sets of 20 objects
> (sets
> 1,2,3,4) according to their preferences.
> I want to analyse wether origin and sex influence similarity in
> rankings so
> I have computed correlations between all pairs of raters (~20,000).
> Cor1 represents the correlation observed between pairs of rater for
> the set
> 1, cor2 represents the correlation observed between pairs of rater
> for the
> set 2 (in the same order of pairs), cor3 for set3 and cor4 for set4.
> id1 represents the identity of one rater and id2 represents the
> identity of
> the other rater within each pair of raters.
> I assume that the set of objects should not influence my fixed
> effects, but
> could influence residuals and random effects.
> I coded:
>
> prior <- list(R=list(V=1,nu=0.002),G=list(G1=list(V=1,nu=0.002)))
> mod <- MCMCglmm(fixed=cbind(cor1,cor2,cor3,cor4)~sex*origin,
> random=~idv(mult.memb(~trait:id1+trait:id2)),
> rcov=~trait:units,
> family=rep("gaussian",4),
> data=data,
> prior=prior)
>
> Does it sounds good? I am particularly worried about the part
> "random=~idv(mult.memb(~trait:id1+trait:id2))".
> Thanks a lot.
> _
> alex
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> 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.
More information about the R-sig-mixed-models
mailing list