Skip to content
Prev 8711 / 20628 Next

code for multiple membership models?

Hi,

This is mainly a reply to Malcolm's earlier email which I had missed  
(I do field work from April-July and don't usually read emails).

To fit the MLWin multimembership model in MCMCglmm:

library(foreign); lips <-  
read.dta("http://www.bristol.ac.uk/cmm/media/runmlwin/lips1.dta")[,c(1,3,5,9:30)]

prior=list(R=list(V=1, nu=0), G=list(G1=list(V=1, nu=1, alpha.mu=0,  
alpha.V=1000)))

m1<-MCMCglmm(obs~perc_aff,  
random=~idv(~neigh1:weight1+neigh2:weight2+neigh3:weight3+neigh4:weight4+neigh5:weight5+neigh6:weight6+neigh7:weight7+neigh8:weight8+neigh9:weight9+neigh10:weight10+neigh11:weight11), data=lips, family="poisson",  
prior=prior)


Unfortunately the book is no longer on their server so I can't compare  
the results. However, I find little evidence for area effects once  
observation level overdispersion is accounted for (default in  
MCMCglmm, but perhaps not fitted in the original analyses).

The next version of MCMCglmm will have more efficient ways of setting  
up multimembership models, and also related models which I don't know  
the name for. Perhaps someone does? For example, imagine you want to  
fit mother and grandmother as random effects for some trait measured  
in offspring. The usual model would be:

random=~mother+gmother

However, if some mothers appear as grandmothers the covariance between  
their effects is estimable and perhaps of interest.  The next version  
will make this possible as random=~str(~mother, ~gmother).

Cheers,

Jarrod


Quoting George Leckie <g.leckie at bristol.ac.uk> on Mon, 6 Aug 2012  
18:36:18 +0100: