The mediating role of comorbid conditions in the association between type 2 diabetes and cognition: A cross-sectional observational study using the UK Biobank cohort

AIMS
Using the UK Biobank cohort, a large sample of middle aged and older adults in the UK, the present study aimed to examine the cross-sectional association between type 2 diabetes and cognition and to assess the hypothesised mediating role of common comorbid conditions, whilst controlling for important demographic and lifestyle factors.


METHODS
Using regression models and general structural equation models, we examined the cross-sectional association between type 2 diabetes status and: fluid intelligence; reaction time; visual memory; digit span and prospective memory; and the hypothesised mediating role of common comorbid conditions: visceral obesity; sleep problems; macrovascular problems; respiratory problems; cancer and depressive symptoms in 47,468 participants from the UK Biobank cohort, of whom 1,831 have type 2 diabetes. We controlled for ethnicity, sex, age, deprivation, smoking status, alcohol consumption, physical activity levels and use of diabetes medication.


RESULTS
Participants with type 2 diabetes had a significantly shorter digit span, b = -0.14, CIs [-0.27, -0.11] than those without type 2 diabetes. Those with type 2 diabetes did not differ from those without type 2 diabetes on fluid intelligence, reaction time, visual memory and prospective memory. The associations that do exist between type 2 diabetes and cognition are consistently mediated via macrovascular problems, depressive symptoms, and to a lesser extent visceral obesity. Respiratory problems, sleep disturbances and cancer did not mediate the association between type 2 diabetes status and measures of cognition.


CONCLUSIONS
Comorbid conditions explain some of the observed association between type 2 diabetes and cognitive deficits. This suggests that prevention, management or treatment of these comorbid conditions may be important to reduce the likelihood of cognitive decline. Treatment studies with long follow-ups are needed to examine this.


Introduction
Cross-sectional and longitudinal research has shown that type 2 diabetes is associated with cognitive deficits (Strachan et al., 1997;van den Berg et al., 2009). A review of cognitive deficits in people with type 2 diabetes found that the most common deficits were in the areas of processing speed (found in 63% of studies), attention (50% of studies), memory (44%), cognitive flexibility (38%), language (33%), general intelligence (31%), and perception and construction (22%) (van den Berg et al., 2009). Few studies have examined the underlying mechanisms. One possibility is that common comorbidities found in those with type 2 diabetes explain the association between type 2 diabetes and cognitive deficits.
Many of these comorbidities have also been associated with cognitive impairments independently of diabetes. First, visceral obesity, assessed by waist circumference has been associated with impairments in executive function, perception, construction, memory and processing speed (Higgs and Spetter, 2018;Prickett et al., 2015;Smith et al., 2011;van den Berg et al., 2009). Second, sleeping disturbances have been associated with impairments in response speed and attentional processing (Killgore, 2010). Third, 25-30% of ischemic stroke survivors develop immediate or delayed vascular cognitive impairments or vascular dementia (Kalaria et al., 2016). Fourth, cognitive deficits are common in people with obstructive lung diseases, such as chronic obstructive pulmonary disease and asthma (Dodd, 2015). Fifth, cognitive deficits have been well documented in patients with cancer, both before and after treatment has started (Pendergrass et al., 2018). Finally, with regard to depression, pronounced deficits have been found in executive function, working memory, attention and psychomotor processing speed in those with major depression (McIntyre et al., 2013).
Given the associations observed in the literature, we hypothesised that the comorbidities of type 2 diabetes mediate the association between type 2 diabetes and cognition. See Fig. 1 for a conceptual model of the hypothesised associations between type 2 diabetes, comorbidities and cognition. To date, this hypothesis has not been tested. Some previous studies did, however, control for comorbidities in attempt to isolate the effect of type 2 diabetes on cognition (Fuh et al., 2007;van den Berg et al., 2009). The results from these studies were mixed, with some studies showing that comorbidities were not a confounder (van den Berg et al., 2009), while another did show confounding by the comorbidities (Fuh et al., 2007). For example, one study showed that depressive symptoms had additive effects on cognitive decline above and beyond the effect of type 2 diabetes (Demakakos et al., 2017). However, no research to date has examined whether the association between type 2 diabetes and cognition is mediated by the above-mentioned comorbidities in one comprehensive study.
Using the UK Biobank cohort, a large sample of middle aged and older adults in the UK, the present study examined the cross-sectional association between type 2 diabetes and cognition, and assessed the hypothesised mediating role of common comorbid conditions, whilst controlling for important demographic and lifestyle factors.

Participants and design
The UK Biobank consists of baseline data collected from 503,325 adults aged 40-69 years recruited via NHS registers across England, Scotland and Wales between 2006 and 2010 (Allen et al., 2012). Participants completed a single 2-3 hour testing session where they first provided written consent, and then completed touch screen questionnaires (measuring lifestyle, environment and medical history), cognitive tasks and face-to-face interviews. Lastly, physical measures and biological samples were taken. Several enhancements were conducted during this time period, where subsets of participants completed more detailed assessments to calibrate the data collected at baseline e.g. mailed tri-axial accelerometers to supplement physical activity questionnaire data. For more detail on how the data was collected see Allen and colleagues (2012). The UK Biobank intend to conduct follow-up assessments where baseline measurements are repeated on subsets of 20-25,000 participants every 2-3 years. One follow-up assessment has been conducted so far on 20,436 participants in 2012-2013. This follow-up assessment utilised a more restricted battery of cognitive assessments, and in a relatively small sample size, therefore the current study utilised only data collected at baseline.  approved by Middlesex University's Psychology Research Ethics Sub-Committee.

Identification of type 2 diabetes
Participants self-reported a Doctor's diagnosis of diabetes. Participants were excluded if they reported being prescribed insulin within one year of diagnosis or were diagnosed before they were 35 years of age. This was done in an attempt to exclude those who likely had type 1 diabetes and maintain only those with type 2 diabetes. Participants who self-reported as having gestational diabetes and who did not report their age of diagnosis were excluded from the study.
Glycated haemoglobin (HbA1c) levels are provided to describe the sample. Blood samples were analysed using the High Performance Liquid Chromatography (HPLC) method in a Bio-Rad Variant II Turbo analyser.

Cognition
Five tasks were used to assess a range of cognitive abilities. These tasks have been shown to be a valid measure of general cognitive functioning (Lyall et al., 2016).

Fluid intelligence test
This task assessed a person's ability to solve problems that require logic and reasoning, but that is independent of acquired knowledge (Kane and Engle, 2002). Participants answered as many questions as possible (out of 13) in 2 minutes. The total number of correct answers was the outcome measure (fluid intelligence score).

Reaction time task
Participants were shown 12 pairs of cards (4 practice, 8 experimental) on the screen and pressed a button when the cards were identical. This task assessed simple processing speed (Karia et al., 2012). Mean time taken to press the button on trials where the cards matched was the outcome measure (mean reaction time).

Pairs memory test
This was a paired associates learning task where participants were shown an array of cards on screen and were asked to remember as many matching pairs as possible. The cards were then turned over to be face down and participants touched as many matching pairs as possible with the fewest attempts. Paired associate learning tasks have been validated as a measure of new learning and memory (Tulsky and Price, 2003;Wechsler, 1997Wechsler, , 1987. The outcome measure was the number of incorrect matches found on the highest level (level 6). A greater number of incorrect matches suggests poorer visual memory as participants were less able to remember where the correct matching pair locations were. This task is referred to as the visual memory task (errors) from here on.

Numeric memory test
In this task participants were shown a sequence of numbers on the screen and, after a 3000 ms blank screen, had to enter the sequence in the correct order using the keyboard. Task difficulty increased by one digit after each correct answer (up to 12) and ended after two consecutive incorrect answers. This is a forwards digit span task and is a validated measure of phonological loop short-term memory store capacity (Baddeley et al., 1998). The maximum sequence length correctly recalled was the outcome measure (digit span).

Prospective memory test
At the beginning of the cognitive assessments participants read the following instruction on screen "At the end of the games, we will show you four coloured shapes and ask you to touch the Blue Square. However, to test your memory, we want you to actually touch the Orange Circle instead". As the final cognition task participants were shown a number of shapes on the screen and were asked to touch the blue square, as they were told they would be. Outcome measures were the number of people that correctly touched the orange circle on the first attempt and on the second attempt (creating a dichotomous outcome of incorrect vs correct). We subsequently refer to these outcomes as 'prospective memory first attempt' and 'prospective memory second attempt'. This task assessed an individual's ability to remember an instruction and recall it at a later time following a cue (McDaniel and Scullin, 2010).

Hypothesised mediators
Visceral obesity was measured using waist circumference, which was determined at the level of the umbilicus by a trained member of staff. Participants who self-reported insomnia "usually" or narcolepsy "often/ all of the time" were coded as having a sleep disturbance (dichotomous variable, no vs yes). Participants were coded as having macrovascular problems if they self-reported a diagnosis of angina, high blood pressure, blood clot, lung clot, deep vein thrombosis, or previous heart attack or stroke (dichotomous variable, no vs yes). Participants were coded as having respiratory problems if they self-reported a diagnosis of emphysema/chronic bronchitis, asthma, or hay fever/allergic rhinitis/ eczema (dichotomous variable, no vs yes). A lifetime cancer diagnosis was also self-reported (dichotomous variable, no vs yes). Depressive symptoms were assessed using four questions from the Patient Health Questionnaire (PHQ-9, Spitzer et al., 1999). These asked "over the past two weeks, how often have you… (1) felt down, depressed or hopeless, (2) had little interest or pleasure in doing things, (3) felt tense, fidgety or restless, (4) felt tired or had little energy?" Answers were scored in line with PHQ-9 scoring guidelines to create a total depressive symptoms score, where a higher score indicates more symptoms (Spitzer et al., 1999).

Confounders
Participants self-reported their ethnicity, sex and age. Ethnicity was recoded as white vs non-white. Townsend deprivation index score was used as a proxy measure of socioeconomic status (Townsend et al., 1988). The score reflects material deprivation, and is based on information about unemployment, housing, access to a car and social class. Higher scores indicate greater deprivation. Smoking status and alcohol consumption were self-reported (never, previous or current), and recoded into dichotomous variables (never vs previous/current). Physical activity was measured via the International Physical Activity Questionnaire (Craig et al., 2003). Data processing guidelines were followed to calculate total MET (metabolic equivalent of task) minutes across walking, moderate and vigorous physical activity (IPAQ, 2005). Specifically, where the sum of walking, moderate and vigorous activity minutes was greater than 960 minutes (indicating implausible levels of physical activity), these values were treated as missing data (N = 682). Use of diabetes medication (dichotomous, yes vs no) was also included as a potential confounder.

Analysis strategy
Data analyses were conducted in SPSS and STATA. Missing data for confounders were imputed using the sample mean. First, the total effect (c paths in Fig. 1) of type 2 diabetes status on cognition were examined using linear regression for continuous outcomes (fluid intelligence score, mean reaction time, visual memory task errors, digit span) and logistic regression for dichotomous outcomes (prospective memory first attempt, prospective memory second attempt). To assess whether comorbid health problems mediate the association between type 2 diabetes status and cognition, we ran a generalised structural equation model (SEM) for each outcome with diabetes status as the predictor variable (X; no type 2 diabetes vs type 2 diabetes), cognition outcomes as the dependent variables (Y: fluid intelligence score, mean reaction time, visual memory task errors, digit span, prospective memory first attempt, prospective memory second attempt) and comorbidities as the mediator variables (M: visceral obesity, sleep disturbances, macrovascular problems, respiratory problems, cancer, depressive symptoms). SEM models were adjusted for demographic and lifestyle factors known to be associated with cognition, including ethnicity, age, sex, deprivation, physical activity MET minutes, and smoking and alcohol consumption by entering these as covariates. Use of diabetes medication was also included as a covariate. Covariates were mean centered. We report the effect of type 2 diabetes status on the hypothesised mediator variables (a paths), the effect of the hypothesised mediator variables on cognition (b paths), and the direct effect of type 2 diabetes status on cognition (c' paths). We also report the indirect effect of type 2 diabetes status on cognition via hypothesised mediators (paths a*b). We consider the six measures of cognition to be a family of tests and have therefore applied a Bonferroni correction of 0.05/6 (p < 0.008, with 99.2% confidence intervals) to the c and c' pathways. We do not consider the six mediators to be a family of tests, and so interpret the a pathways as significant if p < 0.05. The b and axb pathways for each mediator are tested six times (once for each of the six measures of cognition). A Bonferroni correction has therefore been applied to the b and axb pathways and these are interpreted as significant if p < 0.008 (0.05/6, with 99.2% confidence intervals). Bootstrapped confidence intervals (1,000 resamples) were estimated for the indirect effects. Proportion mediated was used as a summary measure of the mediation analyses (indirect effect divided by total effect) (MacKinnon et al., 2007). See Fig. 1 for a conceptual model of the association between variables.

Sample
Only participants who self-reported type 2 diabetes status and had valid responses on all measures of cognition and planned mediator variables were included in the current analyses. The analysed sample consisted of 47,468 persons, of whom 1,831 (3.9%) had type 2 diabetes. There was missing data for some confounding variables: physical activity MET minutes (n = 10,120), smoking status (n = 131), deprivation score (n = 117) and alcohol consumption (n = 24), which were imputed using their mean value. See Table 1 for characteristics of the sample. Participants with type 2 diabetes had a slightly higher age, higher percentage of men, higher percentage of white ethnicity and greater deprivation than those without type 2 diabetes. Participants with type 2 diabetes reported doing less physical activity and were more likely to be previous/current smokers, but were less likely to be previous/current alcohol drinkers than those without diabetes. The type 2 diabetes group had a higher prevalence of visceral obesity, sleep disturbances, macrovascular problems, cancer diagnoses and a greater number of depressive symptoms, but were slightly less likely to have respiratory problems than those without type 2 diabetes. Participants with type 2 diabetes had a much higher average HbA1c. See Fig. 2 for a graphical representation of significant model paths.

Total effects (c paths)
Participants with type 2 diabetes had a significantly shorter digit span compared to controls. Those with type 2 diabetes did not significantly differ from controls on fluid intelligence score, mean reaction time, errors on the visual memory task, and performance on the first and second attempt of the prospective memory task (Table 2).

Effect of type 2 diabetes status on hypothesised mediators (a paths)
Having type 2 diabetes was significantly associated with greater visceral obesity, the presence of sleep disturbances and macrovascular problems, and a greater number of depressive symptoms, but not with respiratory problems or a cancer diagnosis (Table 3). Specifically, compared to controls, people with type 2 diabetes had a 9.09 cm greater waist circumference (visceral obesity), had a 0.07 times increased risk of having sleep disturbances, had a 0.34 times increased risk of having macrovascular problems, and had 0.37 more depressive symptoms.

Effect of hypothesised mediators on cognition (b paths)
A short summary of the results is provided for all comorbidities. For the complete results, see Table 3.

Visceral obesity
Greater visceral obesity was significantly associated with shorter digit span and fewer errors on the visual memory task, but was not significantly associated with any other measures of cognition.

Sleep disturbances
The presence of sleep disturbances was not significantly associated with any measures of cognition.

Macrovascular problems
The presence of macrovascular health problems was significantly associated with shorter digit span, lower fluid intelligence score, longer mean reaction time, more errors on the visual memory task and being less likely to give the correct response first time on the prospective memory task. The presence of macrovascular health problems was not significantly associated with performance on the second attempt of the prospective memory task.

Respiratory problems
The presence of respiratory problems was significantly associated with a longer digit span, higher fluid intelligence score, and being more likely to give the correct answer on the first attempt of the prospective memory task. The presence of respiratory problems was not significantly associated with performance on any other measure of cognition. Note. a Higher scores indicate greater deprivation; b HbA1c = glycated haemoglobin, data missing for 2431 participants; c possible symptom score range of 0-12; d possible score range of 0-13. T2D = type 2 diabetes.

Cancer
Having a cancer diagnosis was not significantly associated with any measures of cognition.

Depressive symptoms
A higher number of depressive symptoms was associated with a shorter digit span, lower fluid intelligence score, longer mean reaction time, more errors on the visual memory task, and being less likely to give the correct answer on the first attempt of the prospective memory task and more likely to give the correct answer on the second attempt.

Indirect effect of type 2 diabetes status on cognition via hypothesised mediators (a x b paths)
The indirect effects of type 2 diabetes status on digit span, fluid intelligence, mean reaction time, visual memory task errors, first attempt on the prospective memory task via an increase in macrovascular problems and depressive symptoms were significant (Table 3). The effect of type 2 diabetes status on the second attempt on the prospective memory task was significantly mediated via an increase in depressive symptoms alone. Macrovascular problems mediated 14-59% of the association between type 2 diabetes status and the different cognitive outcomes, and depressive symptoms mediated 10%-48% of these associations. The effect of diabetes status on digit span and visual memory via an increase in visceral obesity was also significant, with visceral obesity mediating 31-49% of the association for digit span. Respiratory problems, sleep problems and cancer did not mediate the association between type 2 diabetes status and any measures of cognition.

Direct effects (c' path)
The association between type 2 diabetes status and digit span was reduced and no longer significant when the effect of hypothesised mediators was removed (Table 3).

Discussion
Using the UK Biobank cohort, a large sample of middle aged and older adults in the UK, the present study aimed to examine the crosssectional association between type 2 diabetes and cognition and to assess the hypothesised mediating role of common comorbid conditions, whilst controlling for important demographic and lifestyle factors. In this cohort, people with type 2 diabetes significantly differed from controls on one aspect of cognition, namely short term memory, but not on intelligence, processing speed, new learning and memory. These findings are in line with previous reviews that have found inconsistent associations between type 2 diabetes and areas of cognition across studies. For example, in a review van den Berg and colleagues (2009)     recent review concluded that an important measure of diabetes, namely HbA1c levels, only showed a weak negative association with cognitive function, which accounted for less than 10% of the variation in cognition (Geijselaers et al., 2015). Further, in the current study, across all measures of cognition, differences between those with and without type 2 diabetes were small, compared to previous research. Participants with type 2 diabetes remembered 0.14 items less than controls on the digit span task (short-term memory). A previous study found a difference of 1.3 items between those with and without type 2 diabetes (Fuh et al., 2007). Similarly, in our study we found that participants with type 2 diabetes had a reaction time 4.95 ms slower than those without diabetes, yet other studies have found significant differences in reaction time of ~100 ms and more (Muhil et al., 2014;Priya, 2016;Richerson et al., 2005). One possible explanation for the small effects observed in this study is that participants with type 2 diabetes may have had well controlled diabetes (average HbA1c on the day of testing was 52 mmol/mol), which may have prevented large effects on cognition. Further, participants may not have had type 2 diabetes for long enough to observe a large effect on cognition. However, neither of these explanations seem likely considering the widespread existence of comorbid conditions in this sample. Alternatively, it is possible that at a population level the size of the effects of diabetes on cognition are small, in contrast to previous studies that have found larger effects in smaller sample sizes. Finally, the UK Biobank cohort has been found to have healthier lifestyles and fewer self-reported health problems than the general UK population (Fry et al., 2017), which may have reduced the size of any effects in this sample. In this sample, people with type 2 diabetes had greater visceral obesity (waist circumference), were more likely to have macrovascular problems and sleep disturbances, and had a greater number of depressive symptoms. The size of most of these effects was clinically relevant, except for the increased chance of sleep disturbances, which was small (0.07). These effects are consistent with other research findings (Cade, 2008;Holt et al., 2014;Resnick et al., 2003;Russell-Jones and Khan, 2007).
The association between type 2 diabetes and cognitive performance was consistently mediated by the above mentioned macrovascular problems, depressive symptoms, and to a lesser extent visceral obesity. The indirect effect through these comorbidities explained a substantial proportion of the association between type 2 diabetes and cognition (specifically digit span, fluid intelligence, reaction time, prospective memory and visual memory; 10-59% mediation). This is in line with literature finding effects of these health problems on cognition (Kalaria et al., 2016;McIntyre et al., 2013;Smith et al., 2011;van den Berg et al., 2009), and suggests that effects of type 2 diabetes on cognition may at least be partially caused by the comorbidities of type 2 diabetes.
In some models inconsistent mediation was observed. In other words, the direct and indirect effect had opposite signs, cancelling each other out and resulting in a total effect close to zero (MacKinnon et al., 2000). Specifically, in our models with visual memory and performance on the 1st and 2nd attempt of the prospective memory task as the dependent variables, non-significant negative direct effects combined with significant positive indirect effects cancelled out some total effects. Regardless of the inconsistency of the mediation model, the associations between type 2 diabetes and visual memory and prospective memory 1st attempt performance were mediated by depressive symptoms and macrovascular symptoms. The association between type 2 diabetes and prospective memory 2nd attempt performance was mediated by depressive symptoms only. The pattern of these effects is in line with the pattern of mediation described in the preceding paragraphs, i.e. significant mediators were macrovascular problems and depressive symptoms. These results show that an absence of a significant total effect does not imply that there is no mechanism behind the effect of type 2 diabetes on cognition, and that it is important to look past the total effect to gain a more detailed insight into the mechanism behind type 2 diabetes and cognition.
There were also significant indirect effects in mediation models in which direct and indirect effects had the same sign. Specifically, the presence of macrovascular problems and depressive symptoms mediated the association between type 2 diabetes status and mean reaction time, Note. T2D = type 2 diabetes; a possible symptom score range of 0-12; b possible score range of 0-13.
yet the direct and indirect effects were positive. Again, these effects follow the same pattern as the previous results, i.e. macrovascular problems and depressive symptoms were significant mediators. Further, visceral obesity significantly mediated the association between type 2 diabetes status and errors on the visual memory task, however the direct and indirect effects were negative. Visceral obesity, macrovascular problems and depressive symptoms may affect cognition via several pathways. One possible pathway that is common to all three comorbidities is inflammation (Gorelick, 2010;McIntyre et al., 2013;Nguyen et al., 2014;Sullivan et al., 2000). In obesity, adipose hypertrophied adipocytes and resident immunes cells increase levels of proinflammatory cytokines, such as C-reactive protein (CPR) and interleukins (Nguyen et al., 2014). Major depression has been associated with pro-inflammatory markers, where those with greater symptom severity show higher levels of these markers (Raison et al., 2006). A prospective longitudinal study found that depression was associated with later CRP levels, but CRP levels were not associated with later depression status, suggesting that depression caused the inflammation (Copeland et al., 2012). In addition, inflammation is implicated in the development and progression of several types of vascular disease (Sullivan et al., 2000). Other pathways could include oxidative stress in depression (McIntyre et al., 2013) and disruption of the blood brain barrier in obesity (Nguyen et al., 2014). Future research should examine possible common underlying mechanisms for the mediating effects found in the current study.
Some counterintuitive results that deserve consideration are the associations between the presence of respiratory problems and longer digit span, higher fluid intelligence score and being more likely to give the correct answer on the first attempt of the prospective memory task. This is contrary to research finding that respiratory problems are associated with cognitive deficits (Dodd, 2015). One possible explanation is the inclusion of allergy conditions in the categorisation of respiratory problems, which may have obscured effects of other respiratory problems on cognition. Histamine (the body's natural response to allergens in the brain) aids concentration and learning. However, symptomatic allergies are typically associated with cognitive impairments (Church et al., 2016). It is therefore unlikely that the inclusion of allergy-based conditions with respiratory problems contributed to the counterintuitive findings. The consistent pattern of better cognition in those with respiratory problems found in the current study requires further investigation.
Strengths and limitations A strength of the current study is the large sample size that provided sufficient power to detect small effects. The UK Biobank is one of the most comprehensive databases, containing extensive data on participants' lifestyles, environment, medical history and physical measures in men and women aged 40 to 69 years. Consequently, we were able to control for a greater number of potentially confounding variables than has been controlled for before and examined a large number of hypothesised mediators. Further, the UK Biobank cognitive assessments have been shown to be a valid measure of general cognitive functioning (Lyall et al., 2016). Finally, we conducted parallel multiple mediation analysis, which allowed us to control for the effects of other mediators and therefore gives a more accurate picture of the indirect effect through each mediator independently of others (MacKinnon, 2008).
There are also limitations to this study. As this is cross-sectional data, no strong causal inferences can be made. Indeed, reverse causality and bidirectional relationships between type 2 diabetes and the mediators tested are plausible. For example, depression and type 2 diabetes are risk factors for each other (Mezuk et al., 2008) as well as macro-and micro-vascular diabetes complications (Nouwen et al., 2019). As the UK Biobank continues to follow up participants, future work can examine the longitudinal mediating role of common comorbidities in the association between type 2 diabetes and cognitive deficits. All behaviour and diagnoses were self-reported and may be subject to underreporting or misreporting. Indeed, this may be the case for physical activity where many participants had implausible values. Similarly, self-reported diagnosis of cancer included everyone with a current diagnosis and survivors. This is important as cognitive deficits in cancer can vary by time since diagnosis/treatment (Harrington et al., 2010). In attempt to exclude those with type 1 diabetes, we excluded those prescribed insulin within 1 year of diagnosis or diagnosed under 35 years of age. Whilst this likely excluded all people with type 1 diabetes, it may have excluded some with early onset type 2 diabetes. There are other potential mediators that might be of interest to future researchers. For example, other diabetes comorbidities, such as renal dysfunction and retinopathy are also associated with cognitive deficits and likely play a mediating role (Crosby-Nwaobi et al., 2012;Khatri et al., 2009). There are also several aspects of cognition previously found to be impaired in people with type 2 diabetes that were not measured by the UK Biobank, such as cognitive flexibility and attention (van den Berg et al., 2009). Therefore, nothing can be said about the potential mediating role of health comorbidities in these cognitive domains. Finally, the UK Biobank cohort has been shown to have healthier lifestyles and fewer self-reported health conditions than the general population (Fry et al., 2017), which may have limited our ability to identify associations in this study. Our results may therefore not be representative of the general population. More specifically, our results may underestimate the mediating role of comorbid conditions in the association between type 2 diabetes and cognition in the general population.

Conclusions
Comorbid conditions explain some of the observed association between type 2 diabetes and cognitive deficits. This suggests that prevention, management or treatment of these comorbid conditions may be important to reduce the likelihood of cognitive decline. Treatment studies with long follow-ups are needed to examine this.

Data availability
Data was provided by the UK Biobank and is available to any researcher (for a fee).

Funding
Funding was provided by Middlesex University to access the UK Biobank data. The study sponsor was not involved in the design of the study; the collection, analysis, and interpretation of data; writing the report; or the decision to submit the report for publication.

Declarations of Competing Interest
None.