Skip to contents

Introduction

Many clinical and psychological interventions produce effects that evolve over time. When studies report outcomes at multiple follow-up points, a longitudinal meta-analysis (LMA) models the trajectory of the treatment effect across time, rather than selecting a single time-point for pooling.

LMA answers questions that univariate meta-analysis cannot:

  • Does the treatment effect grow, decay, or plateau over time?
  • At which time-point is the effect largest?
  • Is there evidence that long-term and short-term effects differ?

Model specification

Let yity_{it} be the effect estimate from study ii at time t{t1,,tTi}t \in \{t_1, \ldots, t_{T_i}\}, with known standard error sits_{it}. The longitudinal model has two levels.

Level 1 (within-study):

yitθit𝒩(θit,sit2) y_{it} \mid \theta_{it} \sim \mathcal{N}(\theta_{it},\, s_{it}^2)

Level 2 (between-study trajectory):

θit=f(t;𝛍)+ui+vit \theta_{it} = f(t;\, \boldsymbol{\mu}) + u_i + v_{it}

where:

  • f(t;𝛍)f(t;\, \boldsymbol{\mu}) is the population-level trajectory (parametric or non-parametric)
  • ui𝒩(0,τu2)u_i \sim \mathcal{N}(0, \tau_u^2) is a study-level random intercept
  • vit𝒩(0,τv2)v_{it} \sim \mathcal{N}(0, \tau_v^2) is a study-by-time random deviation

Trajectory specifications

Linear trajectory

f(t;𝛍)=μ0+μ1t f(t;\, \boldsymbol{\mu}) = \mu_0 + \mu_1 t

Appropriate when the effect changes at a roughly constant rate. μ0\mu_0 is the effect at t=0t = 0 (baseline) and μ1\mu_1 is the rate of change per unit time.

Exponential decay

f(t;𝛍)=μ+(μ0μ)eλt f(t;\, \boldsymbol{\mu}) = \mu_\infty + (\mu_0 - \mu_\infty) e^{-\lambda t}

Appropriate for effects that peak near treatment initiation and decay toward a long-run asymptote μ\mu_\infty. λ>0\lambda > 0 controls the decay rate.

Piecewise linear (spline)

f(t;𝛍)=μ0+μ1t+jμ2j(tκj)+ f(t;\, \boldsymbol{\mu}) = \mu_0 + \mu_1 t + \sum_j \mu_{2j} (t - \kappa_j)_+

where κj\kappa_j are knot positions and (x)+=max(0,x)(x)_+ = \max(0, x). Flexible enough to capture non-monotone trajectories.

Priors

μ0,μ1𝒩(0,1),τu,τvHalf-Cauchy(0,0.5) \mu_0, \mu_1 \sim \mathcal{N}(0, 1), \quad \tau_u, \tau_v \sim \text{Half-Cauchy}(0, 0.5)

Trajectory-specific parameters (e.g., λ\lambda, μ\mu_\infty) require domain-informed priors. Exponential decay requires λ>0\lambda > 0; a Half-Normal(0,1)\text{Half-Normal}(0, 1) prior is a reasonable weakly informative choice.

Fitting longitudinal models

fit_lma <- bayesma(
  data,
  model_type = "random_effect",
  time_col   = "weeks",
  trajectory = "linear"
)

The time_col argument names the column containing the time variable. trajectory accepts "linear", "exponential", or "spline".

Estimands

bayesma() returns the posterior trajectory f(t)f(t) evaluated on a user-specified grid via bayesma_marginal(). This can be used to:

  • plot the trajectory with pointwise credible bands
  • identify the time of maximum effect
  • compare trajectories across subgroups (via meta_reg())

Alignment across studies

Studies rarely measure outcomes at identical time-points. The model handles this naturally — each study contributes (yit,sit,t)(y_{it}, s_{it}, t) triplets, and the trajectory is estimated across all studies simultaneously. No imputation for missing time-points is needed.

Limitations

  • Longitudinal models require that time is measured comparably across studies (same origin, same units).
  • The trajectory form must be specified. Model comparison between trajectory specifications is supported via compare_models().
  • With k<10k < 10 and heterogeneous time-points, both τu\tau_u and τv\tau_v are poorly identified.