  Causal mediation analysis seeks to investigate how the treatment effect of an
exposure on outcomes is mediated through intermediate variables. Although many
applications involve longitudinal data, the existing methods are not directly
applicable to settings where the mediator and outcome are measured on sparse
and irregular time grids. We extend the existing causal mediation framework
from a functional data analysis perspective, viewing the sparse and irregular
longitudinal data as realizations of underlying smooth stochastic processes. We
define causal estimands of direct and indirect effects accordingly and provide
corresponding identification assumptions. For estimation and inference, we
employ a functional principal component analysis approach for dimension
reduction and use the first few functional principal components instead of the
whole trajectories in the structural equation models. We adopt the Bayesian
paradigm to accurately quantify the uncertainties. The operating
characteristics of the proposed methods are examined via simulations. We apply
the proposed methods to a longitudinal data set from a wild baboon population
in Kenya to investigate the causal relationships between early adversity,
strength of social bonds between animals, and adult glucocorticoid hormone
concentrations. We find that early adversity has a significant direct effect (a
9-14% increase) on females' glucocorticoid concentrations across adulthood, but
find little evidence that these effects were mediated by weak social bonds.
