To further investigate the effects of confounding factors on the association between cancer and the risk of dementia, a series of subgroup analyses stratified by age, sex, ApoE4 status, smoking status, alcohol consumption, BMI [29], and follow-up period were conducted (Fig. 3). The gene discussed is APOE; the disease is dementia.