Marginal correlations from lmer In the book "Applied Longitudinal Analysis" by Fitzmaurice et. al (2012), they fit a model for the six cities study as follows:
require(dplyr)
require(ALA)
require(lmerTest)
data(fev1, package = "ALA")
fev1 %<>% filter(id != 197)
fev1 %<>% mutate(
  loght = log(height),
  logbht = log(height0)
) 
model_1 = lmer(logFEV1 ~ age + loght + age0 + logbht + (1 + age | id),
               data = fev1)

This fits a mixed effects model between logFEV1 and some covariates. They then produce the following table (Table 8.4, p. 219 in the book):


*

*What are the interpretation of these marginal correlations, and how are they actually calculated? The book says they are functions of the covariance matrix of the random effects and the residual variance, but gives no more information that.

*Is there a way to obtain these correlations within R from the fitted lmer model?


Remember that $\text{Cov}(\mathbf{Y}_i)$ is a function of time, $\mathbf{t}_i$.
Z <- fev1 |> 
  arrange(id, age) |> 
  filter(id == '35') |> 
  select(age) |> 
  mutate(intercept = 1, .before = age) |> 
  as.matrix()
Zt <- t(Z)
G <- VarCorr(model_1)[[1]]
sigma2 <- summary(model_1)$sigma^2
Isigma2 <- diag(1, nrow = 12) * sigma2
cov_y <- Z %*% G %*% Zt + Isigma2
cov2cor(cov_y)

You can check the results with the SAS output in the book's web page
