3
$\begingroup$

I am using the lme() funtion in R (from nlme package) to perform a Repeated Measures ANOVA. Here's the formula

lme(Iv ~ Dv1 + Dv2 + Time + Dv1:Time + Dv2:Time, random = ~ 1 | replicate, data = df)

Where Iv is the response variable, and Dv1 and Dv2 are dependent variables. Should Time be treated as a continuous or a categorical variable here? In my case, the measurements were done at 5 different times and the time intervals between each measurement are not equal.

Edit Here's an illustration of how the data looks like: enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ Both are possible. Could you show a plot of the time trajectories? If the trajectories are more or less linear, I'd treat the time continuously (it doesn't matter that they're not equally spaced). If the trajectories exhibit a clear non-linear pattern where a linear or polynomial fit are inadequate, I'd treat the time as discrete. $\endgroup$ Commented Nov 18, 2018 at 15:03
  • $\begingroup$ Thanks @COOLSerdash for your answer. Indeed, they are linear. The results from the two models are quite different. It feels safer using time as a continuous variable though. $\endgroup$
    – Drosof
    Commented Nov 18, 2018 at 19:41

1 Answer 1

4
$\begingroup$

A couple of considerations:

  • Often even though measurements were supposed to be taken at specific time points, in reality, there can be considerable variability in the actual time points at which they were eventually taken. If this is the case also in your data, it is better to consider time as continuous and use the actual time points.
  • Supposing that measurements were taken at the same time points for all sample units, the choice between treating the time as categorical or continuous is one of flexibility versus parsimony. If you treat the time as categorical and you consider the interactions between it and your other explanatory variables, you fit an almost saturated model. This gives you the most flexible fit (i.e., it captures any shape of evolutions over the specific time points), but you spend too many parameters to get it. On the other hand, if you treat it as continuous you assume a linear evolution over time, which is described by just two coefficients (the intercept and slope). If the relationship is truly linear, then you spend the smallest number of parameters to describe it, and hence you'll have more power than if you'd treated it as categorical. A compromise between the two is to treat time as continuous but allow for possible nonlinear evolutions. With this choice, you spend more than two parameters but less than treating it as categorical and often you obtain an adequate fit. Also, this approach allows you to test if the evolutions are linear or not.
  • If you treat time as categorical, you can only obtain fitted values/predictions for the specific time points you considered in the model. That is, you will not be able to obtain the fitted evolution at a time point in between.
$\endgroup$
0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.