  The causal roadmap is a formal framework for causal and statistical inference
that supports clear specification of the causal question, interpretable and
transparent statement of required causal assumptions, robust inference, and
optimal precision. The roadmap is thus particularly well-suited to evaluating
longitudinal causal effects using large scale registries; however, application
of the roadmap to registry data also introduces particular challenges. In this
paper we provide a detailed case study of the longitudinal causal roadmap
applied to the Danish National Registry to evaluate the comparative
effectiveness of second-line diabetes drugs on dementia risk. Specifically, we
evaluate the difference in counterfactual five-year cumulative risk of dementia
if a target population of adults with type 2 diabetes had initiated and
remained on GLP-1 receptor agonists (a second-line diabetes drug) compared to a
range of active comparator protocols. Time-dependent confounding is accounted
for through use of the iterated conditional expectation representation of the
longitudinal g-formula as a statistical estimand. Statistical estimation uses
longitudinal targeted maximum likelihood, incorporating machine learning. We
provide practical guidance on the implementation of the roadmap using registry
data, and highlight how rare exposures and outcomes over long-term follow up
can raise challenges for flexible and robust estimators, even in the context of
the large sample sizes provided by the registry. We demonstrate how simulations
can be used to help address these challenges by supporting careful estimator
pre-specification. We find a protective effect of GLP-1RAs compared to some but
not all other second-line treatments.
