  In studying the marginal effect of antidepressants on body mass index using
electronic health records data, we face several challenges. Patients'
characteristics can affect the exposure (confounding) as well as the timing of
routine visits (measurement process), and those characteristics may be altered
following a visit which can create dependencies between the monitoring and body
mass index when viewed as a stochastic or random processes in time. This may
result in a form of selection bias that distorts the estimation of the marginal
effect of the antidepressant. Inverse intensity of visit weights have been
proposed to adjust for these imbalances, however no approaches have addressed
complex settings where the covariate and the monitoring processes affect each
other in time so as to induce endogeneity, a situation likely to occur in
electronic health records. We review how selection bias due to
outcome-dependent follow-up times may arise and propose a new cumulated weight
that models a complete monitoring path so as to address the above-mentioned
challenges and produce a reliable estimate of the impact of antidepressants on
body mass index. More specifically, we do so using data from the Clinical
Practice Research Datalink in the United Kingdom, comparing the marginal effect
of two commonly used antidepressants, citalopram and fluoxetine, on body mass
index. The results are compared to those obtained with simpler methods that do
not account for the extent of the dependence due to an endogenous covariate
process.
