The UK Biobank cohort study enrolled over 500,000 participants aged 37–73 years at baseline from the general population (5.5% response rate) . In brief, between 2006 and 2010, participants attended one of 22 assessment centers across Scotland, England, and Wales [14, 15]. All participants completed a touch-screen questionnaire, had physical measurements taken, and provided blood, urine, and saliva samples at baseline. Among all UK Biobank participants, about half had linked primary care data and were included in this study (Additional file 1: Fig. S1).
Axivity AX3 wrist-worn triaxial accelerometers were used to collect objective PA measurements from 103,686 UK Biobank participants between 2013 and 2015. The dominant wrist of each individual was used over a period of 7 days at 100 Hz and combined into 5-s epochs for analysis . The 7161 participants with insufficient wear time (<72-h wear), missing data, or poor device calibration were excluded, leaving 96,525 participants with valid device-measured PA data. The median wear time was 6.91 days with less than 20% of participants wearing < 6 days. More details about data collection and processing can be found elsewhere .
Minutes per week (min/week) of light (LPA), moderate (MPA), and vigorous (VPA) PA were determined as the time spent between >30 milligravities (mg) and 125 mg>125 mg and 400 mgand >400 mgrespectively [17, 18], extrapolated from fraction of time spent over the total wear time. This assumes the time spent in various PA was similar in measured and unmeasured period. Total PA was expressed as total metabolic equivalent of task (MET)-minutes/week accounting for both intensity and duration and was calculated as time spent in LPA × 2 + MPA × 4 + VPA × 8, adapting the International Physical Activity Questionnaire scoring recommendation .
Incident affective disorders were extracted from both hospital and primary care records to ensure comprehensive ascertainment. Dates and causes of hospital admissions were identified via record linkage to Health Episode Statistics (England and Wales) and the Scottish Morbidity Records (Scotland). Details of the linkage procedure can be found at http://content.digital.nhs.uk/services. The start of follow-up was the date when all device-measured PA measurements were completed. Participants with affective disorders prior to that date, based on retrospective record linkage, were excluded from the analyzes (Additional file 1: Fig. S1). Retrospective linked data dating back to 2004 were used as the Quality and Outcomes Framework in primary care practices that were implemented that year. Hospital admission data were available until September 2021 in England, July 2021 in Scotland, and February 2018 in Wales. Using the International Classification of Diseases, 10th revision (ICD-10), affective disorders were defined as F30-F39 and F40-F44, depression as F32-33, and anxiety as F40-44.
Age, when PA data were collected, was determined from dates of birth and PA assessment. Ethnicity was self-reported and categorized into White, South Asian, Black, Chinese, mixed ethnic background, and others. Area-based deprivation was derived from postcode of residence, using the Townsend score . Educational attainment was based on self-report of the highest level of qualification. Sleep duration was self-reported in hours as there were no reliable objectively measured data. Smoking status was self-reported and categorized as never, former, or current smoker. Alcohol consumption was calculated based on self-reported frequency and volume of drinking. Dietary intake of fruit and vegetables, red meat, processed meat, and oily fish was self-reported. Height and body weight were measured by trained nurses during the baseline assessment. Body mass index (BMI) was calculated as (weight in kg)/(height in m)2. Longstanding illnesses were self-reported as any longstanding illness, disability, or infirmary.
Descriptive characteristics by quartile of total PA are presented as means with standard deviation (SD) for continuous variables and frequencies with percentages for categorical variables.
Nonlinear associations between PA and incident affective disorders were investigated using penalized cubic splines fitted in Cox proportional hazard models. The penalized spline is chosen as it is not sensitive to knot numbers and placements . In these analyses, PA variables were truncated to be between 2000 and 12,000 MET-min/week for total PA, 300 and 3600 min/week for MPA, 0 and 1800 min/week for MPA, and 0 and 240 min/week for VPA to ensure the reliability at the tail end of the splines. These truncation thresholds were roughly the 1st and 99th percentile for each of the variables. The reference points were the minimum of the truncated PA variables. An analysis assuming linearity was performed in the range where the associations appeared linear to extract easily interpreted estimates. This was replicated to use MET-minutes/week instead of time spent. Analyzes were adjusted for these confounders: age, sex, ethnicity, deprivation, education, sleep duration, smoking, alcohol intake, and dietary intake based on the causal hypothesis shown in Additional file 1: Fig. S1. For analysis of LPA, MPA, and VPA, the three PA variables were mutually adjusted. Because LPA, MPA, VPA, and sleep duration were all included in the model, the hazard ratios of PA could be interpreted as replacing the time spent on sedentary behavior by that PA .
To illustrate the joint association of MPA and VPA with affective disorders, a risk matrix was constructed using the categorized MPA and VPA variables: 0–<150, 150–<300, 300–<600, and ≥600 min for MPA and 0– <15, 15–<45, 45–<75, and ≥75 min for VPA. These cut-offs were chosen based on the current WHO PA recommendations  and the shapes of associations, as well as the distributions. The least active was used as the reference group.
Furthermore, three sensitivity analyzes were performed. Firstly, PA were not mutually adjusted as LPA and MPA (R = 0.42) and MPA and VPA (R = 0.49) were moderately correlated which may lead to unstable HRs. Secondly, BMI and longstanding illnesses reported at baseline were additionally adjusted as these could limit the ability of participants to perform PA, but could also be mediators (Additional file 1: Fig. S1). Thirdly, a 2-year landmark analysis was conducted excluding participants who developed affective disorders in the first 2 years of follow-up (n = 795), in order to minimize the risk of reverse causation due to sub/pre-clinical mental health issues at baseline.
Preventable fractions for the population (PFPs)  were estimated to estimate the proportions of all incident affective disorders that could have been prevented if the individuals in a specific PA categories were as active as the most active group, assuming that the association was causal. It should be noted that this study could not ascertain causality and this analysis only illustrates the relative importance of intensity-specific PA for the study population. All analyzes were conducted using the ‘survival’ packages in R 4.2.0. The proportional hazard assumption was checked using Schoenfeld residuals. A p-value below 0.05 was considered statistically significant.
UK Biobank was approved by the North-West Multi-Centre Research Ethics Committee (Ref: 11/NW/0382). Written informed consent was obtained from all participants.