External Publication
Visit Post

RMS Modeling Longitudinal Responses

Datamethods Discussion Forum [Unofficial] April 24, 2026
Source

This question is regarding the choice of time variable—whether to model time at a finer resolution (days) or at a higher level (years)..

I am analyzing data for a study where the goal is to analyze the duration of medication use before and after intervention, how the trend in medication use changed before and after intervention.

the data structure is as follows

ID ChildDOB Duration (medication use) 101 2018-04-21 2 105 2018-05-10 4 206 2019-07-02 1 107 2019-06-17 10 201 2019-06-17 9 . . . . 103 2021-02-15 5 210 2021-08-17 3 203 2021-09-30 2 215 2021-10-07 1

What I am proposing is to use time as days before and after intervention

ID ChildDOB Duration (medication use) time(days before/after intervention) 101 2018-04-21 2 -680 105 2018-05-10 4 -661 206 2019-07-02 1 -243 107 2019-06-17 10 -258 201 2019-06-17 9 -258 . . . . 103 2021-02-15 5 351 210 2021-08-17 3 534 203 2021-09-30 2 578 215 2021-10-07 1 585

There is a suggestion that we use time in years from intervention instead of days

ID    ChildDOB   Duration (medication use)      time(year before/after intervention)
101   2018-04-21  2                                         -2
105   2018-05-10  4                                         -2
206   2019-07-02  1                                         -1
107   2019-06-17  10                                        -1
201   2019-06-17  9                                         -1
.
.
.
.
103   2021-02-15  5                                         1
210   2021-08-17  3                                         2
203   2021-09-30  2                                         2
215   2021-10-07  1                                         2

I am not in favor of using time as years (1 or 2) before or after intervention. I prefer using time in days(-680, -661, -258, 534 etc…

I am confident that using time in days is the right approach, I like some help understanding a) why time(days) is better than time(years) also b) if using time(days) would change the interpretation in anyway ?

Thanks.

Discussion in the ATmosphere

Loading comments...