Skip to content
Prev 15324 / 20628 Next

How to vary residual variance with covariate and per factor in mcmcGLMM

Many thanks!
Suzanne

From: Jarrod Hadfield [mailto:j.hadfield at ed.ac.uk]
Sent: 30 March 2017 07:44
To: LOMMEN Suzanne; r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] How to vary residual variance with covariate and per factor in mcmcGLMM


cc-ed back to the list...



DIC isn't meaningful in this context - I would ignore it.



My suggestion assumes that the variance increases to the square of the covariate. Sometimes people square-root the covariate (if it is positive) if they want a positive linear relationship. A negative relationship is more tricky. You could have 1/logsize1 but this is going to behave badly at values close to zero, or perhaps 1/size1 or 1/sqrt(size1).



Cheers,



Jarrod
On 29/03/2017 21:13, LOMMEN Suzanne wrote:
Dear Jarrod,



Many thanks for the swift and helpful answer!



Implementing your suggestions works but indeed gives very awkward values and even a negative DIC (which I never experienced before).



Defining instead only the random factors (random = ~ site + subplot + idh(logsize1:treatment:year):units) and no rcov gives much better results, but in both cases the estimates of the variances increase with the covariate  logsize1, while the data suggests it should decrease at high values. I assume this increase with higher covariate values is not a build-in assumption, but rather based on fitting my data? (in which case the fit is not good)?



The DIC values of the more reasonable alternative described above is 2980, while the DIC of my model previously defined (variance invarient for the covariate, but differing in value for each treatment*year combination defined in rcov) gives a DIC of ca 4900. I know I cannot compare these at all since the R- and G-structure are different, but is it worrying to get values that differ so extremely from each other while fixed effects are the same?



Cheers,

Suzanne