Inclusion criteria for cohort studies were: prospective cohort study with assessment of physical inactivity at baseline; >10 year follow-up for all-cause dementia or Alzheimer’s disease; and incident dementia cases recorded both during the first 10 years of follow-up and, among those free of dementia at that point, incident cases of dementia during follow-up starting from year 10.

We conducted an individual-participant meta-analysis according to PRISMA guidelines. The 19 prospective cohort studies for which relevant data on physical inactivity and dementia were available were identified using an electronic search of the Individual-Participant-Data Meta-analysis in Working Populations (IPD-Work) Consortium, 13 the Inter-University Consortium for Political and Social Research ( www.icpsr.umich.edu/icpsrweb/ICPSR/ ) and the UK Data Service ( http://ukdataservice.ac.uk/ ) (16 January 2018). Exposure search terms were “physical activity” and “exercise” and outcome search terms “dementia,” “Alzheimer’s disease,” and “mortality.” For additional individual-level data, we contacted principal investigators of the IPD-Work consortium.

Age, sex, ethnicity (white v non-white), education/socioeconomic status (SES; harmonised into high, intermediate, and low), and prevalent dementia and cardiometabolic disease (coronary heart disease, stroke, and diabetes) were also assessed at baseline. Prevalent cases were excluded from the analyses of relevant endpoints. Other baseline characteristics, treated as covariates, included body mass index (weight (kg)÷(height (m) 2 )) treated as a continuous variable, cigarette smoking (current, former, or never smoker), and alcohol consumption (none, moderate, or heavy). 16

Leisure-time physical activity at baseline was self reported. 14 Some studies had general questions about time spent in leisure-time physical activities, while other studies had information on specific types of physical activity (such as brisk walking, jogging, running, cycling, swimming, football). As our main aim was to evaluate the associations between physical inactivity and dementia, we constructed a measure of physical inactivity defined as no or very little moderate or vigorous physical activity or exercise based on the best available information in each study. Examples of definitions of physical inactivity are “less than 0.5 hour of each (brisk walking, jogging, or running) per week,” “no or very little exercise, only occasional walks,” and “sport activities a few times per year or less.” The definitions of physical inactivity in each of the participating studies are included in the appendix (pages 2-5). In addition, for five cohorts in the IPD-Work consortium, a harmonised three-level variable (low, moderate, and high physical activity) was also available. 15

We selected three cardiometabolic outcomes (type 2 diabetes, coronary heart disease, and stroke) known to be related to physical inactivity 19 20 21 22 23 24 25 as positive controls to evaluate the validity of our approach and to examine the trajectory from physical activity to incident cardiometabolic disease and subsequent dementia. We ascertained these diseases from linked electronic health records from hospital admission, discharge, and mortality registers and via reported physician or health professional diagnosis as described previously (appendix, pages 2-5). 13 26 27 Briefly, incident type 2 diabetes was identified with the ICD-10 diagnostic code E11. 26 For incident coronary heart disease, we included all myocardial infarctions that were recorded as ICD-10 I21-I22 and coronary deaths recorded as ICD-10 I20-I25. 13 We defined incident stroke using ICD-10 codes I60, I61, I63, I64 (for 13 US open-access studies, only a broader definition including codes I60-I69 was available). 27

Data on dementia status at follow-up was extracted from national hospital admissions and death registries and reimbursements for medical treatment of dementia, with any mention of dementia in diagnostic codes as described previously. 16 The definition varied slightly between studies (appendix, pages 2-5). Dementias were defined using the International Classification of Diseases, 10th revision, (ICD-10) codes F00, F01, F03, G30, and G31, with earlier ICD codes converted to ICD-10 codes. 17 18 Codes F00 and G30 were used to define Alzheimer’s disease.

This is a secondary analysis of pre-existing datasets. No patients were involved in setting the present research question, the outcome measures, or in developing plans for recruitment, design, or implementation of the study. No patients were asked to advise on the interpretation or writing up of results. The dissemination plan targets a wide audience, including members of the public, patients, health professionals, and experts in the specialty through various channels: written communication, events and conferences, networks and social media.

Statistical analysis

Syntax and detailed description of the statistical analyses are provided in the appendix (pages 5-11). Briefly, each participant was followed from the date of physical activity assessment to the first record of dementia (or cardiometabolic disease of interest), death, or the end of follow-up. In analyses of the associations of physical inactivity with all-cause dementia, Alzheimer’s disease, and each cardiometabolic disease, we used a two-step approach including study-specific analyses with Cox regression in the first step and pooling the study-specific estimates with random-effects meta-analysis in the second.

Study-specific hazard ratios and their 95% confidence intervals were combined using Knapp-Hartung estimators for between-study variance (these estimates are reported in the text).28 For comparison, the same meta-analyses were run using DerSimonian-Laird estimators for between-study variance (the default method in many software packages; these estimates are reported in the appendix, pages 13-20).29 Two estimators were used because evidence from empirical and simulation studies suggests that the commonly used DerSimonian-Laird variance estimator can produce biased estimates, particularly in meta-analyses based on small numbers of studies with moderate to substantial heterogeneity,29 and the Knapp-Hartung estimator can be less biased and more efficient.28 We calculated I2 and τ to estimate relative and absolute heterogeneity, respectively, among the study-specific estimates (in both indices, higher values denote greater heterogeneity).30

We adjusted the hazard ratios for the association between physical inactivity and dementia and Alzheimer’s disease for age, sex, ethnicity, and education/socioeconomic status (minimally-adjusted), and for body mass index, smoking, and alcohol intake (multivariable-adjusted).

We examined whether the hazard ratio for physical inactivity was non-proportional over the follow-up using pooled individual-participant data from all cohort studies. Two approaches were applied: Cox regression stratified by follow-up period (0 to <5 years, 5 to <10 years, 10 to <15 years, ≥15 years) and flexible parametric proportional-hazards for censored survival data on a log cumulative hazard scale (appendix, page 6).3132

To address reverse causation bias, the analysis was performed separately for incident dementia during the first 10 years of follow-up (when physical inactivity assessment is likely to fall in the preclinical or prodromal stage of dementia) and incident dementia from year 10 onwards in those without a dementia diagnosis at year 10. The underlying assumption in the second set of analyses (at least 10 years separating physical inactivity assessment and dementia diagnosis) is that the physical inactivity-dementia association is less likely to be biased by reverse causation. The 10 year threshold was chosen because studies with repeat measurements suggest physical activity in people with dementia begins to decline approximately a decade before diagnosis.12 For comparison, similar analyses were performed for each cardiometabolic disease.

To examine the robustness of the findings, we performed pre-selected subgroup analyses by sex, age (threshold 60 years), study-specific physical inactivity prevalence (threshold 40%), and method used for outcome ascertainment (electronic records from morbidity registers, mortality registers, or both). Due to smaller sample sizes in these subgroups, the analyses were based on pooled data across all cohorts rather than meta-analysis of study-specific estimates and were adjusted for study in addition to other covariates.

We also performed several other sensitivity analyses. We assumed that the long term level of physical activity has an impact on disease processes. As the value of a single measurement of physical activity reflects both the usual level and random fluctuations unrelated to disease processes, it will yield an underestimation of the true impact of physical inactivity on dementia. To address this potential source of bias, we corrected the hazard ratios using the Rosner method.33 To address potential survival bias, we conducted a Fine and Gray competing risk analysis with dementia and death as outcomes.34 To set the age of disease onset for cardiometabolic disease the same as that for dementia (≈80 years), we repeated the analysis of physical inactivity, incident diabetes, coronary heart disease, and stroke in a subgroup of participants who were alive and free of these diseases at age 65. To assess dose-response pattern, we used a three-level physical activity measure as the exposure.

Finally, to assess the association of physical inactivity with dementia in relation to cardiometabolic disease (that is, having one or more of diabetes, coronary heart disease, and stroke), we created two dementia endpoints for participants with no cardiometabolic disease at baseline and no dementia at year 10: (a) incident cardiometabolic disease followed by incident dementia and (b) incident dementia without preceding cardiometabolic disease. We tested whether physical inactivity was differently associated with these outcomes using the χ2 test (see appendix, pages 7-8).35 In these analyses, pooled data were used.

We used SAS (version 9.4) to analyse associations between physical inactivity and health outcomes separately in study-specific data. Stata (version 15) was used in flexible parametric proportional-hazards models and R (version 3.3.1) for meta-analyses combining study-specific estimates.