1
$\begingroup$

I have ~400 time series with measurements of a response variable over the course of 48 weeks. An intervention occurred at week 24 in each time series. A simulated version is provided below:

set.seed(1234)

x <- 100
y <- 150
z <- 200

noise <- rnorm(48, mean = 100, sd = 10)

for(i in 2:length(noise)){

  if(i < 25){
    x[i] <- x[i-1] + rnorm(1, mean = 0, sd = 100)
    y[i] <- y[i-1] + rnorm(1, mean = 0, sd = 100)
    z[i] <- z[i-1] + rnorm(1, mean = 0, sd = 100)

  }else{
    x[i] <- x[i-1] + rnorm(1, mean = 0, sd = 100) + 10
    y[i] <- y[i-1] + rnorm(1, mean = 0, sd = 100) + 10
    z[i] <- z[i-1] + rnorm(1, mean = 0, sd = 100) + 10
  }

}

df <- data.frame(ID = c(rep(1, 48), rep(2, 48), rep(3, 48)), Time = rep(1:48, 3), Response = c(x,y,z))
df$Intervention <- df$Time > 24

I have used a generalised least squares regression with an interaction term as below:

require(nlme)

glsfit <- gls(Response ~ Time + Intervention + Time:Intervention, data = df)

Although the intervention for each time series is the same, and I have an equal length of observations before and after the intervention for each series, the intervention itself was applied at different times for each participant. For example, one time series may cover the period between 2018-05-20 and 2019-04-21 while another may be between 2017-11-26 and 2018-10-28.

Are the results of this regression therefore invalid and, if so, is it possible to control for the fact that the intervention occurred at different times for each individual time series?

Thank you in advance for your time.

$\endgroup$
  • $\begingroup$ You say "An intervention occurred at week 24 in each time series." and then you say "the intervention itself was applied at different times for each participant" which is a contradiction. How are you indexing time? By calendar, patient, or study? If the intervention is done at week 24 of the study, and participant A and participant B are recruited at weeks 0 and 12, does A get it after 24 weeks on-study and B after 12 weeks on study? $\endgroup$ – AdamO Aug 7 at 15:52
  • $\begingroup$ Thank you for your comment. As an example, Participant 1 may have had the intervention on the 10th of May and Participant 2 may have had the intervention on the 9th of September. The time series show the values for the 24 weeks before the intervention and then 24 weeks afterwards but they will not be the same calendar weeks for each participant. While the method I have chosen may be valid for one time series, is it valid for multiple time series which occurred at different times of year? For instance, could some common seasonality play a role and how might that be controlled for? $\endgroup$ – Alan Cash Aug 7 at 16:54
0
$\begingroup$

Interrupted time series relies on correctly specifying the pre-intervention secular trends in order to detect departures-from-the-mean during the post-intervention era. An advantage of a balanced design is that a simple pre-mean adequately does that, in fact you don't even need to model time effects. Here balanced design means that ALL measures of time: relation to study start, age of participant, and calendar time are BALANCED between randomized intervention groups.

Your design uses a historical control. There are no participants without control. So the imbalance in intervention time is precisely what enables modeling to summarize pre-post effects with some precision.

In general, modeling time-series involves the AGE, PERIOD, and COHORT effects. All separate indices of time. There's a hefty literature on modeling so called "APC" effects.

In the panel dataset, adjust for baseline age, and if necessary baseline calendar year, and adjust for a time-varying measure of time on-study, and at the point of intervention, create an indicator variable and its interaction with time on-study.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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