Random Group By Time Interaction Assume we have two groups of subjects which are measured repeatedly over time with respect to the values of a continuous outcome variable. To analyze the resulting data in R, we might fit a linear mixed effects models of the form:
lmer(Outcome ~ Group * Time + (Time | Subject), data = Data)

Assume also that Time is treated as a continuous variable in the model.
This model essentially assumes that the average temporal profile of the Outcome variable is different across the two groups and that, in each group, there is subject variability in the intercepts and slopes describing the subject-specific temporal profiles. The amount of variability in intercepts and slopes, respectively, is assumed to be the same across the two groups.
What if we wanted to allow the subject-specific intercepts and slopes to exhibit different amounts of variability across the two groups? Could lmer accommodate this through syntax along these lines, say:
lmer(Outcome ~ Group * Time + (Time + Group:Time | Subject), data = Data)

Does this even make sense? 
The reason I ask this is because all linear mixed effects models with fixed effects for Group*Time I've encountered so far include just the (Time|Subject) term so I got intrigued about why this is the case. 
If anyone could shed some light on this for me, I would very much appreciate it. Thank you in advance.
 A: A couple of points:


*

*Because random effects are unobserved, when you integrate them out of the observed data likelihood, the specific choice you have made for their design matrix is translated to a specific structure for the variance-covariance matrix of the outcome variable.

*Hence, by including Group in the random-effects part, you're saying that the covariance structure depends on the different levels of this variable. 

*There is nothing wrong with doing that, it is just not that commonly done. For example, to make an analogy, in univariate data where you use simple linear regression, it can be that the variance of the error terms depends on covariates. There are extensions of linear regression that can handle such situations, but there are not commonly used.

*The following code compares what happens if you ignore/forget to put Group in the random effects:




simulate <- function () {
    n <- 250 # number of subjects
    K <- 8 # number of measurements per subject
    t_max <- 15 # maximum follow-up time

    # we constuct a data frame with the design: 
    # everyone has a baseline measurment, and then measurements at random follow-up times
    DF <- data.frame(id = rep(seq_len(n), each = K),
                     time = c(replicate(n, c(0, sort(runif(K - 1, 0, t_max))))),
                     sex = rep(gl(2, n/2, labels = c("male", "female")), each = K))

    # design matrices for the fixed and random effects
    X <- model.matrix(~ sex * time, data = DF)
    Z <- model.matrix(~ time + sex:time, data = DF)

    betas <- c(10, 2, 3, -1) # fixed effects coefficients
    D <- diag(3) # covariance matrix of the random effects
    D[D == 0] <- 0.2
    sigma <- 1 # sd error terms

    # we simulate random effects
    b <- MASS::mvrnorm(n, rep(0, ncol(Z)), D)
    # linear predictor
    eta_y <- drop(X %*% betas + rowSums(Z * b[DF$id, ]))
# we simulate continuous longitudinal data
DF$y <- rnorm(n * K, mean = eta_y, sd = sigma)
    DF
}

library("lme4")
M <- 100 # number simulated datasets
betas1 <- betas2 <- matrix(0, M, 4)
for (m in seq_len(M)) {
    set.seed(2018 + m)
    DF <- simulate()
    betas1[m, ] <- fixef(lmer(y ~ sex * time + (time | id), data = DF))
    betas2[m, ] <- fixef(lmer(y ~ sex * time + (time + sex:time | id), data = DF))
}

# Root Mean Square Errors for the fixed effects
sqrt(colMeans((betas1 - rep(c(10, 2, 3, -1), each = M))^2))
sqrt(colMeans((betas2 - rep(c(10, 2, 3, -1), each = M))^2))

