Fig. 5

A data-driven DAG illustrates the mediation framework. The first indirect effect (medication use → CKD) is represented by the association between medication exposure (PPI vs. H2B) and CKD, with the p-value derived from a competing risk model for CKD as the outcome. The second indirect effect (CKD → CVAE) is represented by the association between CKD status (CKD vs. non-CKD) and CVAE, with the p-value obtained from a competing risk model for CVAE as the outcome. The direct effect is represented by the association between medication exposure (PPI vs. H2B) and CVAE with adjusting for CKD status in the competing risk model.