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

Jarrod Hadfield j.hadfield at ed.ac.uk
Mon Sep 21 12:48:49 CEST 2015


Hi,

The issue is that both outcomes are binary and you are trying to  
estimate an unstructured residual covariance matrix. The diagonal  
elements (the variances) are not identifiable and so need to be  
constrained. The simplest method is to constrain the matrix to a  
correlation matrix using corg(trait):units.

Its hard to say without knowing what the data are, but I would think  
you need to fit trait in the fixed effect part of the model together  
with an interaction between trait and other predictors.

Also, I would recommend using family="threshold" rather than  
family="categorical" for bivariate problems. I've given the reasons  
for this in older posts. For example, the probit section of:

https://stat.ethz.ch/pipermail/r-sig-mixed-models/2014q1/021875.html

Regarding the correct dimension of the prior for the fixed effects, B  
should be equal to the number of fixed effects fitted. I can't see how  
many you have, but definitely more than 2: it looks closer to 20.

Cheers,

Jarrod





Quoting Iker Vaquero Alba <karraspito at yahoo.es> on Fri, 18 Sep 2015  
22:26:20 +0000 (UTC):

>
>    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:
> 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,singular.ok=TRUE)
>
>                       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
>
>    https://eric.exeter.ac.uk/repository/handle/10036/3381
>
>
> 	[[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