# How to decide whether to treat the time variable as categorical or continuous?

I collected data at four waves (i.e., four time points), and I want to use a linear mixed model to analyze the data. Is it better to treat the time variable as categorical or continuous?

It is unlikely that a random effects model will adequately fit the serial correlation pattern you are likely to see in such data. See this for more.

Are the four time points exactly the times at which measurements were made, or are they target measurement times? If the latter it is best to use the actual measurement times in a continuous-time model (continuous both for the mean Y and for the correlation structure).

If time is indeed discrete (the first case listed above), you can treat it as discrete, which requires 3 degrees of freedom, or as quadratic or a restricted cubic spline with 3 knots, each requiring 2 d.f.

• Thank you! I collected data in May 2019, February 2020, October 2020, and June 2021, and I want to compare whether the dependent variable varied across different waves. Is it better to treat the time variable as categorical or continuous? Feb 20 at 14:12
• The data is from the same large group. Feb 20 at 14:18

It is up to you to chose according to how the different time points relate to each other in your experiment. My intuition is that it should not change anything to the overall result. I would try both and compare.

Edit after your comment : I would treat it as categorical. Many things can have changed from one year to an other, the data was not even collected in the same season.

• Thank you! I collected data in May 2019, February 2020, October 2020, and June 2021, and I want to compare whether the dependent variable varied across different waves. Is it better to treat the time variable as categorical or continuous? Feb 20 at 14:12