Obesity in midlife is linked to greater dementia risk in older age. But poor diet and exercise appear to be early signs of cognitive decline, not risk factors, according to new research from the United Kingdom.

The scientists recruited more than one million women, following their weight, caloric intake and activity levels for nearly two decades. Women who were obese at the study’s start were 21% more likely to develop dementia when compared to women with a clinically favorable body mass index. This result remained constant after controlling for multiple factors, including age, education and smoking status.

In contrast, while early results tied dementia to poor diet and inactivity, that link weakened over time. By year 15, neither of these factors was associated with dementia, the authors reported.

Rather than being risk factors, “[t]he short-term links between dementia, inactivity and low calorie intake are likely to be the earliest signs of the disease, before symptoms start to show,” theorized study author Sarah Floud, Ph.D., of the University of Oxford.

Participants had an average age of 56 and did not have dementia at the study’s start. Fifteen years from the start of the study, more than 18,600 women were diagnosed with dementia. Data was culled from the UK Biobank.

The study was published this week in the online issue of Neurology.