[R-sig-ME] Modelling heterogeneous variances for an interaction term in MCMCglmm?

Jarrod Hadfield j.hadfield at ed.ac.uk
Thu Feb 13 11:15:32 CET 2014


Hi Jackie,

Unless you have a very large amount of data I would be careful about  
fitting 3 12x12 covariance matrices. However, that in itself should  
not generate the error.

Does

prior=list(R=list(V=diag(1),n=0.002),G=list(G1=list(V=diag(12),n=0.002),G2=list(V=diag(12),n=0.002)))

model=MCMCglmm(grad.lin~pop.bin*group,mev=mev,data=data,prior=prior,random=~idh(pop.bin*group):study+idh(pop.bin*group):pop,rcov=~units,nitt=300000,burnin=100000,thin=50)

run? If so can you let me know. If not can you make sure that both  
pop.bin and group are coded as factors.

Cheers,

Jarrod



Quoting Jackie Wood <jackiewood7 at gmail.com> on Wed, 12 Feb 2014  
18:04:22 -0500:

> Hello all,
>
> I am using MCMCglmm and attempting to create a model which allows
> heterogeneous variances for different levels of a moderator variable where
> the moderator is an interaction term. I attempted the run the following
> model:
>
> prior=list(R=list(V=diag(12),n=0.002),G=list(G1=list(V=diag(12),n=0.002),G2=list(V=diag(12),n=0.002)))
>
> model=MCMCglmm(grad.lin~pop.bin*group,mev=mev,data=data,prior=prior,random=~idh(pop.bin*group):study
> +idh(pop.bin*group):pop,rcov=~idh(pop.bin*group):units,nitt=300000,burnin=100000,thin=50)
>
> where "pop.bin" corresponds to bins of population size and has 4 levels,
> and "group" has 3 levels (Fish, Birds, Plants).
>
> When I run the above model I receive the error:
> Error in priorformat(if (NOpriorG) { :V is the wrong dimension for some
> prior$G/prior$R elements4
>
> I tried running a simpler model with just "pop.bin" instead of the
> interaction term and "V=diag(4)" in the prior, and it seems to run just
> fine.
>
> I'm unsure whether the problem is simply too many levels and I perhaps
> don't have enough data or statistical power to run this model or whether I
> made a simple (or huge) error in the model or prior specification. If
> anyone could shed some light on this it would be a huge help.
>
> Cheers,
> Jackie
>
>
> --
> Jacquelyn L.A. Wood, MSc.
> PhD Candidate
> Biology Dept.
> Concordia University
> 7141 Sherbrooke St. West
> Montreal, QC
> H4B 1R6
> Phone: (514) 293-7255
> Fax: (514) 848-2881
>
> 	[[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