My question is conceptual. Suppose $n$ patients, where each one is measured at 4 different time points. The outcome is continuous. The patients are randomly assigned to two groups, intervention yes/no. The first time measurement is the baseline outcome before the intervention, 2nd till 4th time measurements are after the intervention.

Two possibilities (in my view):

  1. Something like: Outcome ~ Intervention, random = ~ patient id | time.

Intervention as fixed effect, random intercepts for each patient, random slopes allowed at different time measurements.

Am I right that the random intercepts already imply a correlation BETWEEN patients whereas random slopes imply a correlation WITHIN patients (even though not explicitly)? In other words, if I didn't assume a correlation within patients over the different time measurements, I wouldn't allow random slopes and I would just estimate a random intercept model. So there is no need in additionally specifying an autoregressive covariance matrix, since an autoregressive pattern is already implied and captured in the model by allowing random slopes to vary over the different time measurements. Am I right about this point?

Another question: Should I include Baseline (= outcome before intervention) as a covariate, e.g., Outcome ~ Baseline + Intervention, random = ~ patient id|time?

  1. Outcome ~ Baseline, random = ~ Intervention | time

Baseline as fixed effect, Intervention as grouping variable, random slopes allowed over different time measurements.

Let's again assume an autoregressive pattern of the error terms (correlation within each patient) over the different time measurements. Here I would actually specify an autoregressive correlation matrix, since a correlation of error terms is not yet captured in the model.

Under the assumption that the variance among groups varies over the different time measurements, should I maybe even consider an unstructured covariance matrix to additionally account for the different variance within groups?

Which model would u prefer and why?

  • $\begingroup$ random = ~ patient id|time = id + time? or id + time + id*time? $\endgroup$
    – user158565
    Oct 11, 2018 at 0:17

1 Answer 1


Some points:

  • In general, you would expect that measurements within a patient over time are correlated. To obtain correct inferences you will need to account for these correlations appropriately.
  • When you only include random intercepts per patient, you assume that all pairs of measurements are equally correlated. This is the so-called compound symmetric correlation structure.
  • When you include both intercepts and slopes, then you postulate that the correlations of measurements that are further apart in time are less correlated. This is the underlying idea of many correlations structures, such as the AR1 structure for example.
  • The whole point is how many parameters do you have to model the correlations. Many of the serial correlation structures you have available in software packages only have a couple of parameters to model these correlations. This may not be sufficient, especially when you have several repeated measurements per subjects.
  • In this context, the random-effects paradigm is more flexible because by including more random effects you can make the correlation structure more flexible. In addition, also note that by including random effects you also automatically assume heteroscedastic error terms (i.e., the variance of your outcome is not constant over time).
  • If you want to see how the random effects model correlation, check Section 3.3 of the GitHub app for my Repeated Measurements course. In the notes for this course, you can find more information regarding these issues, check especially Sections 2.7 and 3.3.
  • Regarding putting the baseline measurement as a covariate in the model instead of treating as an outcome, actually, there is a lot of discussion regarding this. In your case, where you have a randomized trial, it makes sense to do it. But not in general because of potential confounding issues. You can find a nice discussion on the topic in Section 5.6. of the Applied Longitudinal Analysis book by Fitzmaurice, Laird and Ware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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