For analysis of a longitudinal data with repeated measures, should you use continuous or categorical variable for time? I have performed a study over 6 months: measuring pain between two groups of patients at baseline, and at 3 and 6 months after an intervention.
I am performing a LMM analysis: but just now getting confused if I should use time as a categorical variable (ordered or non-ordered) or a continuous variable.
If I use the former (categorical factor), and try the following for a random slope, intercept using R:
pain ~ 1 + intervention*interval + (interval|subject)

I get an error that the number of observations is smaller than number of random effects.
Any help appreciated: the more I read, the more confused I become.
EDIT: Included image of boxplot of scores against time, per study group


The answer will depend on the particulars of the research question. Time is, with the possible exception of durations near Planck scale, continuous. However, aggregations of time are often meaningful and justified by theory.
For example, one might treat time in one time to event model using a continuous variable for time (say, when modeling mean continuous time before failure in units of years), but in another time to event model using a discrete variable for time (say, when modeling time to graduation since matriculation in units of discrete academic terms). The former example "half a year" is meaningful, "but half a term" is not meaningful: people do not graduate mid-way through a term.
The answer for your (or anyone's) specific case must be driven by a temporal theory of the process being modeled.
