[R-sig-ME] MCMCglmm: Fixing the priors in multivariate response models without random effects

Iker Vaquero Alba karraspito at yahoo.es
Sat Sep 19 00:26:20 CEST 2015

   Hello all,
   I have managed to pretty much understand the MCMCglmm function, at least to the point of being able to write a model with just a single response categorical variable and run it. It can be done without any need to specify any priors. However, when I try to run a more complicated model with a bivariate response, the problems start. 
   This is the model I am trying to run and the error message I get:

                      MCMC iteration = 0

  Acceptance ratio for latent scores = 0.000154

                      MCMC iteration = 1000

  Acceptance ratio for latent scores = 0.211168
Error in MCMCglmm(cbind(natapshort, nataplong) ~ gender + age + religion +  : 
  Mixed model equations singular: use a (stronger) prior

So I need to define my own priors. As I am still in the testing stage, I tried some simple ones found in the CourseNotes. Also from the CourseNotes and other sources, I understand that the term G refers to random effects, so I should not include it. Then I should include B and R, am I right? I haven't been able to find very clear information about what G, B and R refer to.
   I have tried this:  
   prior<- list(B= list(B1 = list(V = diag(2), n = 1.002)),R = list(V = diag(2), n = 1.002))
    And this is what I get:
   testmodel1<-MCMCglmm(cbind(natapshort,nataplong)~gender+age+religion+sexor+selfattr+partnerattr+gender:age      +gender:religion+gender:sexor+gender:selfattr+gender:partnerattr+age:religion+age:sexor+age:selfattr+age:partnerattr      +religion:sexor+religion:selfattr+religion:partnerattr+sexor:selfattr+sexor:partnerattr+selfattr:partnerattr,random=NULL,      rcov=~us(trait):units,family=c("categorical","categorical"),data=extphen,nitt=10000,prior=prior,singular.ok=TRUE)
Error in priorformat(if (NOpriorG) { : 
  V is the wrong dimension for some prior$G/prior$R elements

After getting this error, I have tried adding another five B terms (as I have 6 explanatory variables), but the result is tha same. 

If I try just with G and B:
prior<- list(G = list(G1 = list(V = diag(2), n = 1.002)),B = list(V = diag(2), n = 1.002))
>testmodel1<-MCMCglmm(cbind(natapshort,nataplong)~gender+age+religion+sexor+selfattr+partnerattr+gender:age   +gender:religion+gender:sexor+gender:selfattr+gender:partnerattr+age:religion+age:sexor+age:selfattr+age:partnerattr   +religion:sexor+religion:selfattr+religion:partnerattr+sexor:selfattr+sexor:partnerattr+selfattr:partnerattr,random=NULL,   rcov=~us(trait):units,family=c("categorical","categorical"),data=extphen,nitt=10000,prior=prior)

Error in MCMCglmm(cbind(natapshort, nataplong) ~ gender + age + religion +  : 
  either both or neither R and G structures need a prior

   I am getting crazy. Could anybody shed some light on the priors' issue and help me find some simple ones that can make my model work? I don't even know where to look any more, I have read plenty of sources and documents, but I haven't got any clear conclusion yet.
   Thank you very much.   Best wishes,   Iker

   Iker Vaquero-Alba
   Visiting Postdoctoral Research Associate
   Laboratory of Evolutionary Ecology of Adaptations 
   Joseph Banks Laboratories
   School of Life Sciences
   University of Lincoln   Brayford Campus, Lincoln
   LN6 7DL
   United Kingdom


	[[alternative HTML version deleted]]

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