Solved – Time as random effect or fixed effect in glmmADMB

glmmrrandom-effects-modelrepeated measurestime series

I have a longitudinal dataset where patients have a measurement with a date, currently coded as time from end of treatment (days). Now, I want to build a model. Roughly, a zero inflated Poisson model seems to fit outcome best (patients score a number of symptoms, or DS).

To build the model, I use glmmADMB in R. My formula then looks like this:

DS ~ PF2 + EF + QL2 + HNWG + (1|Patient)

Time since treatment could be influencing the outcome.

Does it make sense to include time as a (nested) random effect? Should I include it as a fixed effect?

To get a bit more insight I made a plot. Aside from a slightly elevated start, time does not seem that important, am I correct in my interpretation? Is this enough information? If not, what extra steps should I execute to find out what I should do?

Depressive symptoms over time

Best Answer

Time is a continuous variable, and random effects are categorical variables. Include it as a fixed effect if you think it will describe some of the variation in DS or if you think it would be valuable as part of an interaction term. How many variables you include should also be a factor in your motivations, whether it's prediction or interpreting the system.

Here is a great discussion on fixed and random effects: https://dynamicecology.wordpress.com/2015/11/04/is-it-a-fixed-or-random-effect/ which includes a decision tree for choosing between whether to include something as fixed or random.