[R-sig-ME] Define prior in MCMCglmm

Jarrod Hadfield j.hadfield at ed.ac.uk
Sat Nov 16 08:50:12 CET 2013


Hi Szymek,

Whoops  - I forgot it was dichotomous. idh(X):Y is probably more  
appropriate. (1+x) fits two effects; a) Y effects for the first level  
of X and b) the difference between Y effects between the two levels.   
If X was continous it would make more sense because it would be  
intercept and slope.

Cheers,

Jarrod


Quoting Szymek Drobniak <geralttee at gmail.com> on Fri, 15 Nov 2013  
21:47:35 +0100:

> Hello,
>
> thank you Jarrod for clarifying things, I obviously made a mistake with the
> nu value. I was also wondering - what is the interpretation of idh(1+X):Y
> in case X is a dichotomous variable?
>
> Cheers,
> sz.
>
>
> On 14 November 2013 18:23, Jarrod Hadfield <j.hadfield at ed.ac.uk> wrote:
>
>> Hi Maria,
>>
>> random = ~us(1):subj_ID + us(fin_B):subj_ID  is the same as
>> idh(1+finB):subj_ID and is not the same as (1 + fin_B|subj_ID) in lmer
>> because the idh fixes the covariance between and intercepts and slopes to
>> zero.  us(1+finB):subj_ID is equivalent to the lmer code.
>>
>> Also, a prior of nu=2 (or nu=2.002) could have quite an influence on your
>> posterior. V=diag(2) and nu=1.002 for the 2x2 case gives a marginal prior
>> on the variances that is equivalent to an inverse gamma with shape and
>> scale equal to 0.001. This prior used to be used a lot, but has some bad
>> properties when values close to zero have support. I often use the
>> parameter expanded prior:
>>
>> list(V=diag(2), nu=2, alpha.mu=c(0,0), alpha.V=diag(2)*a)
>>
>> where a is something large.
>>
>> There is no difference between nu and n.
>>
>> Cheers,
>>
>> Jarrod
>>
>>
>> I meant (1 + fin_B|subj_ID), as indicated in glmer() (lme4 package).
>>
>>> And this should be indicated in MCMCglmm() as random = ~us(1):subj_ID +
>>> us(fin_B):subj_ID.
>>>
>>
>>
>>  Quoting Maria Paola Bissiri <Maria_Paola.Bissiri at tu-dresden.de> on Thu,
>> 14 Nov 2013 15:06:26 +0000:
>>
>>  Dear Szymek,
>>> thank you very much for your answer.
>>>
>>> Yes, the random effects were indicated wrongly in MCMCglmm! My intention
>>> is of course to look at variance associated with subjects (subj_ID).
>>> I meant (1 + fin_B|subj_ID), as indicated in glmer() (lme4 package).
>>> And this should be indicated in MCMCglmm() as random = ~us(1):subj_ID +
>>> us(fin_B):subj_ID.
>>> Please, correct me if I am wrong.
>>>
>>> So the model runs with:
>>> k <- length(levels(fallmid$resp_X))
>>> I <- diag(k-1)
>>> J <- matrix(rep(1, (k-1)^2), c(k-1, k-1))
>>> prior <- list(R = list(fix = 1, V = 0.5 * (I+J), n = 2),
>>>                  G = list(G1 = list(V = diag(1), n = 2), G2 = list(V =
>>> diag(2), n = 2)))
>>>
>>> fallmid.MCMCglmm <- MCMCglmm(resp_X ~ lang * ini_pch + lang * manner +
>>> lang * fin_B,
>>>                              random = ~us(1):subj_ID + us(fin_B):subj_ID,
>>>                              family="categorical", data=fallmid,
>>>                              prior=prior
>>>                              )
>>>
>>> In your suggestion you indicate nu=2.002. What does "nu" mean? What is
>>> the difference between nu and n? In the MCMCglmm manual and in the tutorial
>>> they are both defined as "degrees of belief". What does this mean?
>>>
>>> Kind regards,
>>> Maria Paola
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Zitat von Szymek Drobniak <geralttee at gmail.com>:
>>>
>>>  Dear Maria,
>>>>
>>>> I'm not sure what exactly you're trying to test with your model, but to
>>>> start with - your prior specification assumes 2 random effects, and your
>>>> model has only one (a structured covariance matrix with fin_B defined as
>>>> a
>>>> random effect). This specification you've provided is similar to a random
>>>> intercept/slope model - but I can't see why you would like to fit it
>>>> (most
>>>> importantly, you assumed that fin_B is both a fixed and random effect).
>>>> If
>>>> your intention was to look at variance associated with subjects
>>>> (subj_ID),
>>>> and you'd like to see if this variance is heterogeneous for different
>>>> levels of fin_B - you could fit:
>>>>
>>>> MCMCglmm(your_fixed_formula_here, random=~us(fin_B):subj_ID, ...)
>>>>
>>>> and the prior would be (assuming fin_B has 2 levels as you've said)
>>>>
>>>> list(R=list(V=1, fix=1), G=list(G1=list(V=diag(2),nu=2.002)))
>>>>
>>>> that's for start, then have a look at mcmc-series plots to see if it
>>>> mixes
>>>> well and tweak your model further if necessary.
>>>>
>>>> Cheer
>>>> szymek
>>>>
>>>
>>> --
>>> Dr. Maria Paola Bissiri
>>>
>>> TU Dresden
>>> Fakultät Elektrotechnik und Informationstechnik
>>> Institut für Akustik und Sprachkommunikation
>>> 01062 Dresden
>>>
>>> Barkhausen-Bau, Raum S54
>>> Helmholtzstraße 18
>>>
>>> Tel: +49 (0)351 463-34283
>>> Fax: +49 (0)351 463-37781
>>> E-Mail: Maria_Paola.Bissiri at tu-dresden.de
>>> http://wwwpub.zih.tu-dresden.de/~bissiri/index.htm
>>>
>>> _______________________________________________
>>> 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.
>>
>>
>>
>
>
> --
> Szymon Drobniak, PhD. || Population Ecology Group
> Institute of Environmental Sciences, Jagiellonian University
> ul. Gronostajowa 7, 30-387 Kraków, POLAND
> tel.: +48 12 664 51 79 fax: +48 12 664 69 12
> szymek.drobniak at uj.edu.pl
> www.eko.uj.edu.pl/drobniak
>



-- 
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