# Longitudinal RCT modeling of continuous time

I have data from an intervention study (10 clinics, 5 control, 5 treatment). The outcome is counts, and we have monthly data at baseline, treatment active phase, and post treatment phase. The number of months in each of these longitudinal phases differers between clinics, e.g. clinic A might have 2 months baseline, 12 months treatment active, and 3 months post (treatment stopped). Clinic B might have 1 month baseline, 15 months treatment active and 4 months post (treatment stopped). Whats more, the study start date differs between clinics. However there are matched pairs (each pair has a control and a treatment clinic) which do have the same start date and number of months in each longitudinal phase.

The aim is to quantify the effect of treatment which could be done with a simple pre post type analysis using a model appropriate for counts e.g. Poisson regression. However, to maximise information available, I was thinking to somehow include time in the model. Im really not sure how to approach this but here I have some thoughts...

The model would be something like (pseudo-code):

count ~ log(exposure) + treatment + phase + rcs(time) + other covariates, family = Poisson,...


Where treatment is categorical (no (control) vs yes), phase is categorical (baseline, active, or post), time is some kind of relative time e.g. time since start active phase in months modeled using a restricted cubic spline (rcs). Baseline can be negative e.g. time = -2 months would imply the second to last month before active phase. Accounting for multiple measures per subject might be done using a random effect term or cluster robust standard errors. One problem I forsee is that because there is a time ordering of the phases, this might be highly correlated with the spline term for time. I would really appreciate some advice on my idea or alternative "better" approaches.

Update

The outcome is the number of patients which have taken up (i.e. "uptake") a particular health intervention. Shown below are total counts, but we also have these separately for men and women. We also have total number of patients as well as total visits. I had thought of using the number of visits as an offset term in the model.

The same subjects can be appear in several months since they may visit the health center many times. However, once a particular subject is recorded to have a clinical intervention in a particular month, that subject is removed from the risk set and so does not appear in subsequent months.

The main interest is post intervention, but it seems wasteful to me to ignore the intervention phase itself since we have the data. I also think that this will assist in modeling the trajectory of the uptake over time.

Below is a plot of counts over time for the 10 centers (rows). The matched pair centers as mentioned above are: 1 & 2; 3 & 4; 5 & 6; 7 & 8; and 9 & 10

• @EdM, I noticed your answer here: stats.stackexchange.com/a/500834/167591, which I thought is quite related to my question. I would greatly appreciate your thoughts on this question :) Commented Jul 3, 2023 at 19:03
• Thanks for the notice. The "@" callout on this site, however, only works in a comment thread that the individual is already involved in. I nevertheless found this question myself. The nature of the "count" outcome isn't very clear to me. Please edit the question to say more about it (at least provide typical values, ideally some representative plots over time, even if you can't say what the count variable is). Also, if this trial is for regulatory purposes, you shouldn't be tampering with the analysis plan at this point, at least without prior consultation with the regulatory agency.
– EdM
Commented Jul 6, 2023 at 20:17
• Really glad you noticed the question @EdM! I have tried to provide some further details including a plot of counts over time for the 10 centers. Commented Jul 8, 2023 at 15:54
• I'm not clear what "The outcome is the number of patients which have taken up (i.e. "uptake") a particular health intervention" means. That would seem to be a cumulative type of thing, yet the count values can drop over time. What's going on? Are these "uptake" values for different patients at different times? Or are these longitudinal observations on the same patients? Or something intermediate? For example, might an individual be seen for a few months during the study and "uptake" evaluated for that individual for those but not for other months? Please edit the question to clarify.
– EdM
Commented Jul 8, 2023 at 16:28
• I've added a bit more details. I'm finding it difficult to articulate. The centers receive an intervention (treatment vs control) in a statistical sense, but the outcome measure itself is a medical intervention to the patient Commented Jul 9, 2023 at 17:12