  Mediation analysis aims to decipher the underlying causal mechanisms between
an exposure, an outcome, and intermediate variables called mediators. Initially
developed for fixed-time mediator and outcome, it has been extended to the
framework of longitudinal data by discretizing the assessment times of mediator
and outcome. Yet, processes in play in longitudinal studies are usually defined
in continuous time and measured at irregular and subject-specific visits. This
is the case in dementia research when cerebral and cognitive changes measured
at planned visits in cohorts are of interest. We thus propose a methodology to
estimate the causal mechanisms between a time-fixed exposure ($X$), a mediator
process ($\mathcal{M}_t$) and an outcome process ($\mathcal{Y}_t$) both
measured repeatedly over time in the presence of a time-dependent confounding
process ($\mathcal{L}_t$). We consider three types of causal estimands, the
natural effects, path-specific effects and randomized interventional analogues
to natural effects, and provide identifiability assumptions. We employ a
dynamic multivariate model based on differential equations for their
estimation. The performance of the methods are explored in simulations, and we
illustrate the method in two real-world examples motivated by the 3C cerebral
aging study to assess: (1) the effect of educational level on functional
dependency through depressive symptomatology and cognitive functioning, and (2)
the effect of a genetic factor on cognitive functioning potentially mediated by
vascular brain lesions and confounded by neurodegeneration.
