Background: Previous studies have reported conflicting results on the association between metformin and risk of dementia which might be caused by varied drug responses of metformin in different population subgroups. We aimed to examine the heterogeneous treatment effects (HTEs) of metformin on dementia risk in the population with type 2 diabetes (T2D).

Method: Using 2005-2021 data from the National Alzheimer’s Coordinating Center (NACC), we identified individuals with diabetes (≥50 years old, ≥2 clinic visits) and normal cognition at baseline. The primay outcome was incident dementia. We applied a causal machine learning approach - doubly robust learning - to estimate the conditional average treatment effects (CATEs) in the overall cohort and then the HTE subgroups based on the identified important features using a summary decision tree model.

Results: Of 1,505 individuals with T2D, 822 (55%) were taking metformin at baseline and 683 (45%) were not. 109 participants (7.2%) developed dementia over a median follow-up of 4.0 years. In the estimation of CATEs in the overall cohort, metformin was associated with a lower risk of dementia (Risk difference [RD], -2.9%; 95% confidence interval [CI], -5.9% to -0.002%). We identified four subgroups with varied risks for dementia in those on metformin therapy, defined by neuropsychiatric disorders, alcohol abuse, and antidepressant use. Metformin was significantly associated with a lower risk of dementia in the subgroup with no neuropsychiatric disorders and no alcohol abuse (-5.9%; -9.6% to -2.3%); however, it was associated with a greater risk in those with neuropsychiatric disorders and no antidepressant use (7.4%; 0.8% to 14.0%).

Conclusion: Metformin use was significantly associated with lower risk of dementia in individuals with T2D, with significant variability among subgroups. Data-driven subgroup analyses may guide personalized treatment for diabetes care.


H.Tang: None. J.Guo: Consultant; Pfizer Inc., Research Support; PhRMA Foundation, NIH - National Institutes of Health. C.Shaaban: None. Z.Feng: None. Y.Wu: None. T.Magoc: None. W.T.Donahoo: None. S.T.Dekosky: Advisory Panel; Acumen Pharmaceuticals, Cognition Therapeutics, Other Relationship; Biogen, Prevail Pharmaceuticals, UpToDate, Up-To-Date. J.Bian: None.


National Institute on Aging (1R01AG076234-01); National Institute of Diabetes and Digestive and Kidney Diseases (R01DK133465)

Readers may use this article as long as the work is properly cited, the use is educational and not for profit, and the work is not altered. More information is available at