In the multivariable model, APOE ε4 (SHR = 1.89, 95% CI 1.22–2.92, p = 0.005), diabetes (SHR = 1.56, 95% CI 1.00–2.39, p = 0.043), heart disease (SHR = 1.56, 95% CI 1.03–2.36, p = 0.037), stroke (SHR = 2.31, 95% CI 1.35–3.95, p = 0.002), and delirium (SHR = 8.70, 95% CI 3.26–23.24, p <  0.001) were independently associated with increased dementia risk. Here, APOE is linked to diabetes mellitus.