Skip to content

BLUPs from MCMCglmm

3 messages · Eryn McFarlane, Ben Bolker, Jarrod Hadfield

#
Eryn McFarlane <mcfarlas at ...> writes:
from these models?


  I *think* you can just look at the $Liab component of the fit,
which as stated is the posterior distribution of the latent variables --
you need to set pl=TRUE.

  This should get you started (although HPDinterval() isn't
behaving sensibly in this case -- not quite sure why not)

 data(PlodiaPO)  
     model1<-MCMCglmm(PO~1, random=~FSfamily, data=PlodiaPO, 
    verbose=FALSE, pl=TRUE)
str(model1$Liab)
mm <- data.frame(m=colMeans(model1$Liab),HPDinterval(model1$Liab))
plot(mm[order(mm$m),"m")
#
Hi,

The random effects are actually stored in Sol (solutions) and will be  
saved if you use the argument pr=TRUE.  The marginal posterior modes  
of the random effects should coincide with BLUPs if the variances are  
fixed a priori to the value used when obtaining BLUPs and the fixed  
effects are either fixed a priori or are given improper flat priors.  
However, in practice (i.e. when the variances are not fixed etc.) the  
correlation between BLUPs and marginal posterior modes is usually very  
very high.

Be aware that if you have many (m) random effects and you store many  
(n) iterations you end up with a lot (m*n) of numbers  to store.

Cheers,

Jarrod
On 18 Jan 2012, at 14:51, Ben Bolker wrote: