3
$\begingroup$

I'm trying to handle some data and get some insights from it.

The data includes a binary outcome variable, so I am using glmer.

The relationship is whether age groups are more likely to engage in the outcome variable. The issue is that many participants have multiple observations, over a time span of about two years.

I've created a model that includes participant ID as a random effect, which is good.

glmer(Modality ~ Age_Quartile + (1|pt_number), family = "binomial", data = tel)

The issue I'm running into is including time. I'm not sure if I want to include it at all, but it seems that the relationship seems to switch at a point in time (based on some EDA), so I feel it should be included. However, I'm not sure if it should be put in as a separate random effect, or if it should be nested in the participant ID, and if so, which direction the nesting should be.

Options:

Separate effect:

glmer(Modality ~ Age_Quartile + (1|pt_number) + (1|monthnum), family = "binomial", data = tel)

Time nested within ID:

glmer(Modality ~ Age_Quartile + (1|pt_number/monthnum), family = "binomial", data = tel)

ID nested within time:

glmer(Modality ~ Age_Quartile + (1|monthnum/pt_number), family = "binomial", data = tel)

I appreciate any help, and I apologize if my question is too vague.

Thank you!

$\endgroup$
2
  • $\begingroup$ Good question. I'm curious to see answers; my instinct would have been to include time as a fixed effect if I supposed that the time factor would not vary from person to person. Do you think time matters globally or within each person's set of records? $\endgroup$
    – rolando2
    Commented Mar 21 at 12:57
  • $\begingroup$ With regards to the association "switching" by time, is this something that happens for many/most around the same time period? I see that you have time coded as number of months. Does this happen for most people at say, month #5? $\endgroup$
    – Erik Ruzek
    Commented Apr 18 at 19:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.