Skip to content

MCMCglmm bivariate with offset

3 messages · Jarrod Hadfield, Walid Mawass

#
Hello everyone,

I am working on a bivariate MCMCglmm model and I want to include an 
offset term for my second response variable. I already know that for the 
offset, i have to fix the coefficient to 1 through the prior but it is 
not working in my case. I have 4 fixed effects fitted for both response 
variables and the offset is fitted for the second one using 
/at.level(trait,2)/.

prior1 <- list(B=list(V=diag(5)*1e8, mu=rep(0,5)), R=list(V=diag(2), 
nu=3), G=list(G1=list(V=diag(2), nu=3),G2=list(V=diag(2), nu=3)))
prior1$B$mu[5]<- 1
prior1$B$V[5,5]<- 1e-8

is this the proper way to set the prior? or should the fixed effects 
matrix have different dimensions since my model is bivariate:

model_multi <- MCMCglmm(cbind(AFR, OffMortality)~trait-1 + trait:COEFPAR 
+ trait:I(COEFPAR*COEFPAR) + trait:TWIN + trait:YEARM+ 
at.level(trait,2):log(FERTILITY), random = 
~us(trait):animal+us(trait):MOTHERW, rcov = ~us(trait):units, data = 
IAC, pedigree = prunedPed, family = c("gaussian", "poisson"), nitt = 
3500000, burnin = 500000, thin = 3000, prior = prior1, verbose = FALSE, 
pr=TRUE)

Thank you in advance for any advice.
#
Hi, 

I think you have 11 fixed effects, not 5. Replace 5 with 11 and then it should work. Also, you should expect the posterior to be sensitive to the prior if you have nu=3 unless there is a lot of information in the data.

Cheers,

Jarrod

  
    
#
Thank you Jarrod, the model finally ran with your advice. I am aware of 
the sensitivity of the posterior distribution, this is just my first 
prior. I am going to use another one with nu = 1.002.

Cheers

Walid
On 6/13/2018 2:08 PM, HADFIELD Jarrod wrote: