[R-sig-ME] heterogeneous residual variances using rcov in MCMCglmm?
m.fairbrother at bristol.ac.uk
Tue Oct 25 13:57:06 CEST 2011
Am I right in thinking that the "rcov" term in a call to MCMCglmm can allow for heterogeneous residual (level-1) variances, where the heterogeneity is across level-2 units? If so, how do I make use of rcov in this way?
Consider the "BTdata" dataset included in the MCMCglmm package. The following worked fine to estimate a two-level model, with observations nested within dams, with a single residual variance across all dams:
prior <- list(R = list(V = 1, nu = 0.002), G = list(G1 = list(V = 1, nu = 0.002)))
m1 <- MCMCglmm(tarsus ~ sex, random = ~dam, prior = prior, data = BTdata)
However, the variance of tarsus varies quite a bit by dam:
summary(by(BTdata, BTdata$dam, function(x) var(x$tarsus)))
(The variance is NA for one dam because there is only one observation for that dam.) How therefore would I allow for heterogeneous residual variances? I tried the following to estimate a unique residual variance for each dam:
m2 <- MCMCglmm(tarsus ~ sex, random = ~dam, rcov=~idh(dam):units, prior = prior, data = BTdata)
However, this fails and asks for a different set of priors, which I have not been able to figure out. So two questions:
(1) Does this call to MCMCglmm make sense? (Or should I be trying some other approach? I don't believe this can be done using lme4 and (RE)ML.)
(2) And how should I be specifying the priors for the MCMCglmm call?
If you're wondering why I want to do this, I am following the advice given in: http://pan.oxfordjournals.org/content/15/2/165.
Any assistance would be much appreciated.
More information about the R-sig-mixed-models