# Mixed effects logistic regression with repeated measures and binary outcome

I have an experimental array with a binary dependent variable. Each subject belongs to 1 of 3 groups. Each subject answers 10 questions, 5 of which belong to category A and 5 of which belong to category B. My goal is to examine the interaction between the group level and the category as well to examine the group and categories main effects. I'm using the glmer function from the lme4 package:

glmer(binary_outcome ~ category * group + (1|subject_ID),


Does this formula capture the relevant aspects of the experimental array?

binary_outcome ~ category * group + (category|subject_ID)

• you might find that the model is singular (i.e., you don't have enough information to fully estimate the among-subject variation in the category effect, which includes the variance in both categories and the correlation among categories). See e.g. the Barr et al. 2013 "keep it maximal" paper. If so, you could fall back to a random term of (1|subject_ID/category), which will be easier to estimate.
• with 10 binary responses per individual, you probably should consider using Gaussian quadrature rather than the default Laplace approximation, e.g. nAGQ=10
• I rarely answer questions about plm because I'm quite unfamiliar with the panel approach and its correspondence with the other flavors of mixed models ... it would usually take me some effort to get up to speed with the question ... – Ben Bolker Jun 19 '18 at 12:11