Skip to content
Prev 20156 / 20628 Next

Mixed models with a dichotomous outcome, random slopes, and accounting for autocorrelation

This seems to have slipped through the cracks, sorry about that.

  lme4 doesn't do correlation structures, but glmmTMB does. The closest 
analogue would be something like

## this should be observation number within group
dat$times <- numFactor(dat$times)

model2 <- glmmTMB(continuous_outcome ~ 1 + Predictor_X + Day +
    (1 + Day | Team / Year) + ar1(times + 0 | Team:Year)

  (your random effect has two | in it; was the second meant to be a / ?)

See https://glmmtmb.github.io/glmmTMB/articles/covstruct.html
On 2023-01-25 5:13 p.m., Adam Roebuck wrote:

  
    
Message-ID: <4822b960-ba6f-b8ff-d8b9-5ccd6db46e51@gmail.com>
In-Reply-To: <CABDmvJ9xQgV+zr31OZE9WcRdXnRTWeKRfvccuLUQhipErxr0CQ@mail.gmail.com>