[R-sig-ME] LME4 to MCMCglmm
tw at netstorm.be
tw at netstorm.be
Fri May 4 10:04:10 CEST 2012
Hi all,
I am trying to run an lme4 model (logistic regression with mixed effects)
in MCMCglmm but am unsure how to implement it properly.
Currently, my lme4 model formula looks as follows: "outcome ~ (1 + var1 +
var2 | study) + var1 + var2"
In English, this means that I am fitting a random effects model, where the
intercept, var1 and var2 are jointly distributed according to study.
My question is now how I would translate this formula to the fixed and
random terms in MCMCglmm.
For the fixed part, I figured that I should make a variable
nooutcome=abs(1-outcome) because it can then be modeled with a
multinomial2 family as there is no binomial(logit) option available.
Then, the fixed part would look as follows:
cbind(outcome,nooutcome)~1+var1+var2
However, I am unsure how to specify the random effects over the intercept,
var1 and var2 jointly. So far, I was able to generate the following:
random=~us(var1):study+us(var2):study+us(1):study
which I think corresponds to "outcome ~ (1 | study) + (0+var1 | study)
+ (0+var2 | study) + var1 + var2" instead of "outcome ~ (1 + var1 + var2
| study) + var1 + var2"
I would appreciate any help.
Thomas
More information about the R-sig-mixed-models
mailing list