# glmer repeated measures binomial - why do I need to include time as random?

I have a response (y/n) taken at 4 time points for two treatments, for the same individuals in each treatment. I've found other answers which say time needs to be included in the model as below, can someone explain why it needs to be included like that please?

 model <- glmer(response ~ time*treatment + (1+time | person), data, family=binomial)


Thanks!

• Adding time as a random effect allows the slopes to vary by person over time.
– Glen
Aug 22, 2017 at 16:40
• Thanks Glen, so to confirm time and person are both random effects now? Or person is a random effect, given multiple measurements are taken for the same person, and time is also a random effect to account for the fact individual responses will vary over time? Also do I need to include the 1+ ? Aug 23, 2017 at 0:17
• Person is random, I'm not sure whether I'd call time random though, you still get a fixed overall effect from the model. I think reading this post will help you: stats.stackexchange.com/questions/31569/…
– Glen
Aug 23, 2017 at 17:10

     model <- glmer(response ~ time*treatment + (1+time | person), data, family=binomial) # correlated slopes and intercept