Skip to content

How to constrain varcov of 2 random effects so that correlation between random terms is 1 and only one global variance is estimated?

2 messages · Alexandre Courtiol, Jarrod Hadfield

#
Hi Alexandre,

It sounds like you want to fit something called a multi-membership  
model.  Imagine a data set set out like:

y  A  B

1  a  b
0  a  c
2  c  b
0  b  a
3  a  d

you want the effect of a in A to equal the effect of a in B, such that  
the random effect model for the 1st and 4th row are identical. Is this  
correct?

If so the covariance matrix for the random effects should actually be  
[V,V,V,V] rather than [V,1,1,V].

I'm not sure if multi-membership models can be fitted in lmer but some  
earlier posts suggest not. In MCMCglmmm you can fit this model by  
fitting

random=~idv(mult.memb(~A+B))

Note that this only fits a single variance V.  A and B have to be  
factors with the same levels, although it is not necessary that all  
levels are represented in each factor. In the example above, d only  
appears in B, but the analysis will still work as long as d is a level  
in A. i.e. factor(A, levels=union(A,B)).

The initial set up may be slow because the design matrices are not  
treated as sparse, but once it is MCMCing in C++ it is working with  
sparse matrices and should be relatively speedy.

Cheers,

Jarrod








Quoting Alexandre Courtiol <alexandre.courtiol at gmail.com>: