[R-sig-ME] Redirect from R-help Digest, Vol 103, Issue 15: [R] MCMCglmm heteroscedasticity dependent on predictor
Atle Torvik Kristiansen
atletorvik at gmail.com
Fri Sep 16 19:56:20 CEST 2011
------------------------------
Message: 26
Date: Thu, 15 Sep 2011 12:47:48 +0000
From: Ben Bolker <bbolker at gmail.com>
To: <r-help at stat.math.ethz.ch>
Subject: Re: [R] MCMCglmm heteroscedasticity dependent on predictor
Message-ID: <loom.20110915T143333-659 at post.gmane.org>
Content-Type: text/plain; charset="us-ascii"
Atle Torvik Kristiansen <atletorvik <at> gmail.com> writes:
> I have a dataset where the residual variance decreases with on one of
> the predictors (population size).
>
> Currently, the full model looks like this:
>
> prior<-list(R=list(V=1e-16, nu=-2),G1=list(V=diag(2), nu=2))
>
> m<-MCMCglmm(response~poly(population size,2)*poly(other
> predictor,2)+time, random=~us(1+time):population, data=data,
> prior=prior)
>
> Basically, it's a random regression with multiple populations measured
> multiple times.
>
> I have limited knowledge of MCMC, so:
>
> 1) Does the specification of the prior seem sensible?
Reasonably so for the group variance,
but the residual variance looks a little funny:
why is the expected value (V) so close to zero, and
why is 'nu' negative? Is that a typo?
> 2) How do i specify rcov? Is e.g. rcov=~us(population size):units a
> good approach?
As far as I can see, you can't specify a response of
residual variance to a _continuous_ covariate in MCMCglmm --
only to categorical (grouping) variables. I could be wrong,
but a skim through the "CourseNotes" vignette doesn't show
any other kinds of examples.
> 3) If I would like to include the other predictor in the rcov
> specification. Is this a good approach, rcov=~us(other
> predictor:population size):units?
I would worry about this after you deal with #2.
>
> I know I could easily do this in nlme, but I'm hoping to avoid it. One
> reason is that I understand MCMC methods make it straightforward to
> assess the relative contribution of each predictor to the response.
Hmmm. Maybe you could expand on that. How do you want to do that?
It might be easier to find a way to do that assessment with the
results of nlme than to
Alternatively, you may be stuck learning either AD Model Builder
or WinBUGS (in which you can structure the model however you
want ... you might try the glmmBUGS package to get started ...
I would strongly recommend that you send follow-ups to
the r-sig-mixed-models at r-project.org mailing list (I would
redirect this myself if I weren't posting via Gmane ...)
> Atle Torvik Kristiansen
>
>
Hello Ben,
I'm glad you replied.
1) The residual prior is from Hadfield's course notes (Vignette) page
78, where he has specified a model with similar random effect. I haven't
quite gotten to grips with the Inverse-Wishart, but I believe this is an
improper flat prior. Not quite sure why I'm using it this way though?
2) I've read through the course notes and overview, and I can't find
anything on continous covariates either. I've also made several searches
on Google with no result. However, I did some preliminary model
selection on random effect structures, and end up with the same model,
with or without the rcov specification. I am therefore guessing that
MCMCglmm handles the residual heterogeneous variance in my dataset all
by itself? I do end up with a very complex model with e.g. a cubic
random effect, so I'm a bit concerned about overfitting.
3) Yes.
4) Well, near the bottom of page 62 of the course notes, Hadfield
describes a way of assessing the proportion of the total variance
explained by one of the random effects (dams). It seems he divides the
markov chain of the dams by all the other random effect markov chains.
He also states somewhere else that in Bayesian models there is no
technical difference between random and fixed effects. Thus, this
approach should be applicable to a fixed effect also, i.e. doing this
with model$Sol instead of model$VCV? Seems reasonable to me, but I've
been way wrong in the past.
Thank you for your help, it's been extremely helpful.
Kind regards,
Atle Torvik Kristiansen
More information about the R-sig-mixed-models
mailing list