My dataset (long format) contains of data collected in 4 studies. Although the variables in the studies were identical, I want to account for the heterogeneity of the population between these studies and thus treat "study" as a random effect.
In the study, participants made 25 binary choices (0/1). I want to test, whether attitudes and trait self-control predict making choice 1.
Thus, my logistic regression model should account for the fact that one subject made 25 decisions and that the subjects were nested within one study.
I would suggest the following: model <-glmer(depvar ~ attitude + selfcontrol + (1 | subject) + (1 | study), data = df, family = binomial("logit"))
Is that correct? Thank you for any advice!