I am seeking statistical advice on the random-effects structure of a mixed-model. I am using R's lme4 package.
Based on recent papers showing the importance of the random-effects structure (such as http://www.sciencedirect.com/science/article/pii/S0749596X12001180), I would like to make sure that my random-structure is correct.
More specifically, I have predictors A and B and dependent variable Y.
Predictor A constitutes the experimental manipulation (every subject comes twice to the lab, undergoing treatment 1 or 2), and I have mulitple observations of the dependent variable Y (100 per participant, "ID"). B in contrast, is a nuisance variable (i.e., Hunger), which is assummed to be constant over the short time of the experiment.
Now I am not sure how to correctly specify the random effects if
a) I am interested (a priori) in the interaction between A and B. Would
summary(a<-glmer( Y ~ A * B + (1 + A*B|ID), data= x, family="binomial"), REML=FALSE)
or
summary(a<-glmer( Y ~ A * B + (1 + A|ID), data= x, family="binomial"), REML=FALSE)
be the correct model?
b) Assuming I am only interested in the main effect of A. B (e.g., hunger, or something that is constant over all experimental seesions, such as age) is considered a nuisance variable. Would
summary(a<-glmer( Y ~ A + B + (1 + A + B|ID), data= x, family="binomial"), REML=FALSE)
or
summary(a<-glmer( Y ~ A + B + (1 + A|ID), data= x, family="binomial"), REML=FALSE)
be the correct model? Based on the post Mixed Model Analyses with Interactions in the Random Effects Structure I would suggest the second, but please let me know if I am incorrect.
Thank you, Laura