1
$\begingroup$

I have a dataset structured like so:

   Person_ID Group_ID Year Outcome Cutpoint1 Cutpoint2 Demographic1 Demographic2
1          1        1 2001       1         0         0            1            1
2          2        1 2011       1         1         1            0            1
3          3        2 2010       0         1         0            0            1
4          4        3 2009       1         1         0            0            0
5          5        4 2011       0         1         1            0            0
6          6        5 2012       1         1         1            1            1
7          7        5 2012       0         1         1            1            0
8          8        6 2018       0         1         1            0            0
9          9        7 2018       1         1         1            0            0
10        10        8 2003       0         0         0            0            1
11        11        9 2014       0         1         1            0            1
12        12       10 2014       0         1         1            0            1
13        13       11 2000       0         0         0            0            0
14        14       12 2008       0         1         0            0            1
15        15       13 2010       0         1         0            1            0
16        16       13 2007       1         1         0            0            0

where data are measured at the level of Person_ID, clustered within groups. However, the data also span multiple years, with observations from the same year in some groups (e.g., group 5) but not others. I want to determine whether the probability of a binary outcome differs according to two demographic variables and two different events indicated by binary cut points (e.g., before 2011 versus 2011 and after), controlling for dependence within groups as well as within years. Note that the dataset is much larger than this, with measurements for 500 people in about 150 groups over 25 years.
I have specified the model as such, with all variables except year as factors, year centered at the earliest year, and random intercepts for group and year:

    glmer(Outcome ~ Demographic1 + Demographic2 +
         Cutpoint1 + Cutpoint2 + (1|Group_ID) + (1|Year), data=data,
         family=binomial(link=logit),
         control = glmerControl(optimizer = "bobyqa"))

I know that I should also evaluate whether random slopes are necessary, but is this a reasonable model to begin with based on my research question? Does it adequately address concerns about dependence among observations due to year, while isolating the relationships of cutpoints 1 and 2 with the outcome? Should I include a fixed effect for year as well? Is it a problem to include so many variables related to time? Any input is appreciated. Thanks for your help.

$\endgroup$
  • $\begingroup$ Check out this previous CV thread: stats.stackexchange.com/questions/439337/… If the explanation in that thread aligns with what you want out of this model, then yes, you can run your model as you've proposed. $\endgroup$ – Erik Ruzek Jun 5 at 16:59
  • $\begingroup$ This is very helpful, thank you! $\endgroup$ – letitburn Jun 5 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.