Background

Chronic pain is defined as the pain that persists or recurs for more than 3 months [1], including explainable symptoms, such as headaches, stomachs, and facial pains, or idiopathic sources with an unknown origin for the illness, such as widespread generalized pain. As a major cause of disability, chronic pain can lead to a series of secondary issues, resulting in decreased physical function, poor quality of life, and increased psychological distress [2]. The prevalence of chronic pain ranges from 18 to 20% globally [3,4,5], and up to 50% of adults in the UK were suffering from chronic pain [6]. Chronic pain may alter patients’ pain tolerance [7] and cognitive and emotional function [8]. Accumulating evidence showed that chronic pain and pain-related symptoms are premorbid risk factors for various psychological comorbidities [9, 10]. The mechanisms between chronic pain and mental disorders are complex. Many studies have explained this from a molecular biology perspective, but whether individuals’ daily movement behaviors affect the association remains unclear [11].

A recent meta-analysis showed that, among people who suffered from chronic pain, resulted pain catastrophizing, fear of pain, and pain vigilance may lead to pain-related negative affect, anxiety, and depression [12]. According to the fear-avoidance model, chronic pain and related negative affect can result in avoidance behavior and reducing the intensity of activities [13]. It was suggested that driven by the increased tendency to minimize discomfort or decreased confidence in coping with pain [14], avoidance behavior triggered by chronic pain [15, 16] would inevitably change patient’s 24-h movement behaviors [17]. As a result, existing literature has found that patients with chronic pain were more likely to report reduced level of physical activity and sleep deficiency [18, 19]. In addition, lower levels of physical activity, inadequate sleep, and prolonged inactivity are also associated with higher risk of various mental disorders [20,21,22]. However, most studies only considered the role of a single component of movement behavior in the relationship between chronic pain and mental disorder [23, 24]. According to the Activity-Balance Model and Time-Use Epidemiology Theory [25, 26], 24-h movement behaviors (i.e., including moderate-to-vigorous physical activity (MVPA), light physical activity (LPA), sedentary behavior (SB), and sleep (SLP)) have an interconnected nature which should be considered as a whole when investigating it in health outcomes. Therefore, to provide a more comprehensive understanding about the mediation effect of 24-h movement behaviors, the current study has adopted compositional data analysis. In addition, it has remained unclear about the optimal balance points for different movement behaviors among the patients with chronic pain. At present, many countries and regions, such as Canada and New Zealand, have developed physical activity guidelines for adults or adolescents based on 24-h movement behaviors [27, 28]. The World Health Organization (WHO) suggested adults should undertake ≥ 150-min moderate or ≥ 75-min vigorous physical activity per week [29]. However, evidence from a randomized controlled trial (RCT) showed that this guideline may not be applied to the population with chronic pain symptoms (such as fibromyalgia) [30]. In addition, unlike self-reported data, which is prone to recall bias and social desirability bias [31], 24-h movement behaviors measured by accelerometer are an objective measure to improve the accuracy and reliability of the findings [32, 33].

The current study based on the UK Biobank population aimed to (i) explore the association between chronic pain, 24-h movement behaviors, and incident mental disorders; (ii) address the role of 24-h movement behaviors in the relationship between chronic pain and mental disorders; (iii) determine the dose–response relationship of 24-h movement behaviors on mental disorders among individuals without chronic pain and deliver a recommendation of movement behaviors allocation across 24 h for people with chronic pain.

Methods

Study design and population

The UK Biobank (application # 90162), a nationwide prospective cohort study, was used to conduct the current analysis. Over 500,000 participants aged 40–69 years were included in the cohort study between 2006 and 2010, providing first-record information on genetics, demographics, health-related characteristics, physical activity, etc. From 2013 to 2015, a total of 236,519 participants were randomly invited to wear accelerometers continuously on their dominant hand over a 7-day period. At the end, data containing participants’ 24-h movement behaviors was received from a total of 103,660 participants. Based on these participants, the exclusion criteria were as follows: (1) the participants who withdrew (n = 10); (2) The participants had insufficient duration of equipment (less than 72 hours or no data during each hour of the 24-hour cycle (n = 6991); (3) the participants whose records are with missed covariate information at baseline (n = 11,016); and (4) the participants who had mental disorders at baseline (n = 581). After the screening, a total of 72,800 participants were included in the study (Fig. S1 in Additional file 2).

Assessment of chronic pain

In the UK Biobank, data on chronic pain was ascertained from a touchscreen questionnaire at the baseline assessment between 2006 and 2010. Participants were asked to choose one or more conditions (i.e., headache, facial pain, neck or shoulder pain, back pain, stomach or abdominal pain, hip pain, knee pain) that interfered with usual activities based on the situation of the past month. Participants who reported any site of pain were asked whether their pain lasted for more than 3 months. Therefore, chronic pain is defined as having pain that lasts longer than 3 months in one or more sites, consistent with the definition of the International Association for the Study of Pain (IASP) [34]. Those who answered pain all over the body would be excluded as evidence showed that pain all over the body may differ from one who selected seven individual sites of pain [35, 36].

Assessment of 24-h movement behaviors

From 2013 to 2015, 24-h movement behaviors were measured via a wrist-worn Axivity AX3 triaxial accelerometer over a 7-day period. The data was captured at 100 Hz with a dynamic range of ± 8 g and then further underwent calibration to local gravity, noise and gravity removal, and non-wear detection by the UK Biobank accelerometer expert working group to form a dataset for analysis. Twenty-four-hour movement behavior was divided into four components across the 1440 min of the day, namely, MVPA, LPA, SB, and SLP. Each component represents time spent in the activity relatively, and different activities are independent of and associated with each other in a 24-h period. According to previous studies [35, 37,38,39,40], acceleration intensity distribution was used to define 24-h movement behaviors by calculating the proportion of time spent on different activities except sleep hours. Sleeping time was evaluated by an item of touchscreen questionnaire “About how many hours sleep do you get in every 24 h? (please include naps)”. Responses < 1 or > 23 were rejected automatically. Therefore, SB, LPA, and MVPA were defined as ≤ 30 milli-g (minus sleep duration), > 30 milli-g and < 125 milli-g, and ≥ 125 milli-g, respectively.

Ascertainment of outcomes

The occurrence of diseases was extracted from the first occurrences of health-related outcomes based on the International Statistical Classification of Diseases and Related Health Problems 10th Revision (ICD-10) coding. The main outcome was overall mental disorders (ICD-10 code: F00-F99); see Table S1 in Additional file 2. Depression (ICD-10 code: F32, F33, F34, F38, F39) and anxiety (ICD-10 code: F40, F41) were also analyzed as secondary outcomes. The ascertainment of these outcomes was based on the collation of primary care data, hospital inpatient data, death register records, and self-reported data. Each participant will be followed from the date of the first assessment until the date of death, occurrence of any study outcome, or the last known follow-up date as of 10 August 2022, depending on whichever came first.

Covariates

Age, gender, ethnicity, education level, BMI, current smoking and alcohol use, history of cancer, and history of pain-related diseases were included as covariates. Age and gender were obtained from the central registry at recruitment. Ethnicity, education level, current smoking, and alcohol use were self-reported through a touch screen questionnaire at baseline. BMI was calculated using height and weight and divided into triple categorical variables (< 18.5, 18.5 ~ 25.0, > 25.0). History of cancer was ascertained from cancer registries (NHS Digital and Public Health England for England and Wales; NHS Central Register for Scotland), defined as an ICD-10 code of C00-C99. Pain-related diseases (ICD-10 code: L98, M05-M06, M13, M16-M19, M45, M46, M79, M86, M60, G72) were extracted from the first occurrence of health-related outcomes [41].

Statistical analysis

Categorical variables were presented as frequency (percentage). Continuous variables were presented as mean ± standard deviation (SD), except for 24-h movement behaviors, which were described by geometric mean component time. For better interpretation and less spurious correlation of 24-h movement behaviors, our study used compositional data analysis (CoDA) proposed by Aitchison et al. [42] to interpret 24-h data by isometric log-ratio (ilr) transformations of the simplex [43]. The compositional mediation model, proposed by Ziqiang Lin et al. [44], was used to calculate the estimates and mediation proportion by the mediators (time spent in each movement behavior in 24 h) for the association between chronic pain and each outcome. Compared to using single movement behavior as a mediator, the compositional mediation model considers all types of movement behaviors over a 24-h period. Our study extends this approach by combining the Cox proportional hazard models (Additional file 2). The proportional hazard assumption was tested by Schoenfeld residuals before fitting compositional Cox proportional hazard models, and we found no significant deviation from the assumption.

To explore the dose–response relationship of 24-h movement behaviors on outcomes, we used the compositional Cox isotemporal substitution model (ISM) to analyze the effect of each component in 24-h movement behaviors on outcomes in chronic pain versus pain-free populations separately (Methodology supplement in Additional file 2) [45]. In each group, the geometric means of the four components were set as the reference values (HR = 1). The modification effect was evaluated by creating the interaction term between chronic pain and 24-h movement behaviors.

To find practical recommendations for individuals with chronic pain, a time-use combination was conducted following the methodology in Dorothea Dumuid et al. [46]. Firstly, based on the compositional Cox ISM mentioned previously, using 10 min as the amount of variation between the different components, the combinations of practicable physical activity times were ascertained in the chronic pain population mentioned above (truncated at ± 2 SD of their univariate distributions). Then, the compositional Cox regression models in the first step were used to determine the mapping relationships between time-use combination patterns, and the three outcomes predicted scores in the chronic pain population. Third, the score of overall mental disorders, depression, and anxiety were ranked with the bottom 25%, 50%, and 75% of predictions corresponding to a range of time-use combinations as regions for ‘high risk’, ‘median risk’, and ‘low risk’.

In addition, subgroup analysis was conducted to investigate whether age, gender, ethnicity, smoking, and drinking modified the relationship between chronic pain and outcomes and the mediation proportion of 24-h movement behaviors in different subgroups. We evaluated the potential modification effect by testing additive interaction and the mediation proportion of 24-h movement behaviors.

Several sensitivity analyses were performed in our study to test the robustness of our main results. First, we excluded participants with prevalent diabetes, CVD, cancer, chronic bronchitis, emphysema, or chronic obstructive pulmonary disease, because these diseases may be associated with chronic pain and affect individuals’ mental health. Second, we excluded cases that occurred within the first 2 years of follow-up to reduce potential reverse causation. Third, we used the classification of the patient health questionnaire-9 (PHQ-9) and generalized anxiety disorder-7 (GAD-7) questionnaire to replace incident depression and anxiety. Fourth, we used the E-value methodology [47] to examine the influence of potential confounders and biases. Fifth, we repeat our analysis by regarding the Patient Health Questionnaire (PHQ)-4 scales as long-term mental health outcomes predictors. All statistical analyses were performed using the SAS 9.4 and R software 4.3.0 (R Development Core Team, Vienna, Austria).

Results

Population characteristics

The study included a total of 72,800 participants, with 26,989 (37.07%) of them reporting suffering chronic pain. Among all participants, the mean age was 55.8 ± 7.9 years old, with 55.3% being female. Descriptive results of the population are presented in Table 1. Over two thirds (70.6%) of the participants were overweight, most (95.1%) were currently using alcohol, and 60.3% had never smoked. Forty-eight percent of them obtained an educational level of college or university above, and 64.9% were employed. Adults experiencing chronic pain were more likely to be female, overweight, smokers, currently non-drinkers, and retirees. The incidence of overall mental disorders, depression, and anxiety among participants with chronic pain were 8.10, 2.77, and 2.51 per 1000 person-years, respectively, which were higher than that in the population without chronic pain (5.88, 1.44, 1.66 per 1000 person-years, respectively). The geometric means and proportion of each movement behavior were presented (Fig. 1).

Table 1 Characteristics of UK Biobank participants by pain status
Fig. 1
figure 1

Geometric mean of 24-h movement behaviors. A Participants with no chronic pain. B Participants with chronic pain. MVPA, moderate-to-vigorous physical activity; LPA, light physical activity; SB, sedentary behavior; SLP, sleep

Compositional mediation analysis of 24-h movement behaviors in the association between chronic pain and the risk of mental disorders

After adjusting for the covariates, compositional mediation Cox model analysis was conducted (Table 2 and Fig. 2). The hazard ratio (HR) for the incidence of overall mental disorders, depression, and anxiety among participants with chronic pain compared to those without chronic pain was 1.281 (95% CI: 1.219 to 1.344), 1.703 (95% CI: 1.551 to 1.871), and 1.391 (95% CI: 1.280 to 1.536) (Table 2). Chronic pain was associated with decreased MVPA, LPA, and SLP and increased SB (\(\beta\): − 0.065 (95% CI: − 0.072 to − 0.057), − 0.006 (95% CI: − 0.010 to − 0.003), − 0.011 (95% CI: − 0.013 to − 0.009), and 0.014 (95% CI: 0.011 to 0.016)) (Fig. 2). The effects of MVPA and SB on overall mental disorders, depression, and anxiety were found, while there was no significant relationship between SLP and all outcomes. With MVPA and SB as mediators, there were significant indirect effects on depression, with an adjusted HR of 1.023 (95% CI: 1.023 to 1.030) and 1.006 (95% CI: 1.003 to 1.009). It means that decreased MVPA and increased caused by chronic pain were associated with higher risk of incident depression. Total indirect effects of 24-h movement behaviors were found in the relationship between chronic pain and all outcomes, accounting for 5.70%, 6.86%, and 10.77% of the total effect for overall mental disorders, depression, and anxiety, respectively (Table 2). Similar results were found in anxiety and overall mental disorders. Subgroup analyses showed that the associations between chronic pain and depression was greater in females (p for additive interaction: 0.008) and overweight participants (p for additive interaction: 0.001) (Fig. S2 in Additional file 2). The association between chronic pain and overall mental disorders was also greater in females (p for additive interaction: 0.005) (Fig. S4 in Additional file 2). In addition, the mediation proportion of 24-h movement behaviors in depression and overall mental disorders were greater among the people aged 65 and above, with 19.16% and 32.87% respectively, compared to 3.37% and 7.33% in younger people. It means that elderly people with chronic pain may be more susceptible to effects of 24-h movement behaviors (Appendix Figs. S2 and S4 in Additional file 2).

Table 2 The hazard ratios of direct, indirect, and total effects of chronic pain on outcomes mediated by 24-h movement behaviors
Fig. 2
figure 2

The mediating effect of chronic pain to mental orders mediated by 24-h movement behaviors. Model adjusted for age, gender, ethnicity, BMI, smoking status, drinking status, education, cancer, and pain-related diseases. MVPA, moderate-to-vigorous physical activity; LPA, light physical activity; SB, sedentary behavior

Dose–response relationship between chronic pain, 24-h movement behaviors, and mental disorders

When predicting depression, similar trends were found in the effects of LPA and SB in both participants with and without chronic pain (p for interaction: 0.842 and 0.571 respectively) (Fig. 3 (3.1 B and C)). Increased MVPA was negatively associated with incident depression among both participants with and without chronic pain, while the effect was weaker in the chronic pain group (p for interaction: 0.028) (Fig. 3 (3.1 A)). Changes in SLP had no significant effect in the group without chronic pain. Nevertheless, increase in SLP showed greater benefits for the group with chronic pain. If time in SLP increases from 420 to 480 min/day, the risk of overall mental disorder would be decreased by up to 10%. Similar results were found for depression and anxiety (Figs. 3 (3.2) and Fig. 3 (3.3)). Notably, the effect of the interaction between SLP and chronic pain on overall mental disorders was significant (p for interaction: 0.025) (Fig. 3 (3.1 D)), suggesting that among individuals with chronic pain, increased SLP can reduce the risk of overall mental disorders more effectively.

Fig. 3
figure 3

Dose–response relationship (with 95% CI) between 24-h movement behaviors and mental disorders. A MVPA vs residual component. B SB vs residual component. C LPA vs residual component. D SLP vs residual component. Models adjusted for age, gender, ethnicity, BMI, smoking status, drinking status, education, cancer, and pain-related diseases. MVPA, moderate-to-vigorous physical activity; LPA, light physical activity; SB, sedentary behavior; SLP, sleep

Twenty-four-hour time use combinations associated with the highest risk of incident overall mental disorders depression and anxiety in the chronic pain population

In the chronic pain population, the ilrs contain four components associated with overall mental disorders, depression, and anxiety (all p < 0.001). The analyses produced similar time-use combinations (MVPA < 0.5 h per day, SLP < 7 h per day, SB > 11.5 h per/day), associated with the highest risk of overall mental disorders, depression, and anxiety (Table 3).

Table 3 Twenty-four-hour time use combinations with the highest risk of incident mental diseases

Sensitivity analysis

The robustness of our findings was confirmed by the sensitivity analyses using alternative parameters. The sensitivity analysis results showed no significant change except when using the scores of depression and anxiety scales as outcomes in the mediation analysis of chronic pain and sleep duration (Figs. S5-11 and Tables S2-9 in Additional file 2). A decrease in SLP increased the risk of incident depression (adjusted odds ratio (OR): 1.011, 95% CI: 1.008 to 1.016) and anxiety (adjusted OR: 1.010, 95% CI: 1.006 to 1.014).

Discussion

Previous studies have reported that chronic pain was associated with an increased risk of mental disorders [9, 10]. A meta-analysis suggested patients with chronic pain are more likely to develop psychological problems such as depression, anxiety, and phobias [48]. Meanwhile, sufficient daily physical activity and decreased SB help lower the risk of mental diseases [49, 50]. Based on previous theories and research [25, 27, 28, 51], it is necessary to explore how people with chronic pain can prevent mental diseases through the proper allocation of 24-h movement behaviors. However, little research has examined the mediation role of 24-h movement behaviors in the relationship between chronic pain and mental disorders. By analyzing the UK Biobank (median follow-up time: 13.36 years), we found that the durations of MVPA and SB mediated the association between chronic pain and mental disorders.

In the current study, individuals with chronic pain showed a higher risk of overall mental disorder, depression, and anxiety by 28%, 70%, and 39%, respectively. This increased risk may be due to reduced physical activity levels caused by chronic pain. Indeed, our results showed that people with chronic pain have more time in SB and less in LPA, MVPA, and SLP, whereas decreases in MVPA and increases in SB lead to a greater risk of mental disorders. A semi-structured interview guide showed that most patients with chronic pain see SB as a means to adapt to everyday life [52]. Previous studies also suggested that physical activity could irritate the pain sites [53,54,55], and patients may be discouraged from engaging in moderate or vigorous physical activities, believing they should take additional rest to relieve the pain. Nevertheless, systematic reviews of RCTs and prospective cohort studies have indicated that active engagement in physical activity would lower the risk of mental disorders [56, 57]. This may be because appropriate physical activity can activate the endocannabinoid system and release endorphins, resulting in pain relief and happiness [58, 59]. Furthermore, people with chronic pain may experience feelings of inferiority that increase the risk of mental disorders, but exercise may buffer against this risk by improving social interaction, self-esteem, and self-efficacy [60, 61]. Consistent with the evidence mentioned above, our study found that although the effect of MVPA in the chronic pain population was lower than that in the pain-free population, the relationship between MVPA and mental disorders in the chronic pain population was not distorted. Several studies have also provided evidence for this perspective that physical activities among individuals with chronic pain. Under planned and supervised conditions, physical activity has been shown to bring benefits—including but not limited to pain relief, reduced disability scores, improved social functioning, and enhanced mental health [62,63,64]. Therefore, we believe that patients with chronic pain should appropriately increase MVPA based on the existing activity routine. Evidence from randomized controlled trials (RCTs) indicated that moderate-to-high intensity physical activities, such as neuromuscular exercise [65], inverted bicycle riding [66], yoga [67], and dancing [68], are effective in reducing symptoms of depression or lowering perceived stress in individuals suffering from chronic pain. We strongly recommend that patients with chronic pain tailor their exercise regimen based on their needs and physical conditions. Based on our findings mentioned above, patients with chronic pain should increase their MVPA and reduce SB in daily life. However, there is a lack of literature on how individuals with chronic pain should allocate the 24 h. Consequently, we utilized a 24-h time use combination based on the isotemporal substitution model to develop a guideline. A combination of daily engagement in MVPA > 0.5 h, SLP > 7 h, and SB < 11.5 h can significantly reduce the incident mental disorders. Compared with clinical therapeutic interventions such as taking opioids and minimally invasive procedures, physical activity is a more cost-effective approach with fewer side effects. Therefore, chronic pain patients should engage in physical activity, particularly MVPA, properly.

Although other study reported increased sleep time in patients with chronic pain [44], our study showed decreased sleep time in this population. Extensive studies suggested chronic pain and sleep disturbance interact in a complex bidirectional way [19, 69]. Chronic pain was reported to be associated with more extended insomnia [70], difficulties in falling asleep, excessive awakenings, early awakenings, and malaise [71]. Meanwhile, sleep deficiency affects various systems of nociceptive processing, leading to a vicious cycle [19]. Consistent with these findings, we found that an interaction between chronic pain and sleep time when affecting mental disorder. Only in the chronic pain population did we observe a significant dose–response relationship between sleep time on all outcomes, suggesting that the effects of SLP differed in the group with and without chronic pain. In summary, compared with pain-free populations, adequate sleep time brought greater benefits and reduced the risk of morbidity in chronic pain populations. Therefore, complementary therapies, such as mindfulness and relaxation that can improved sleep quality and relieved pain [72], should be considered and integrated in regimens.

To improve the stability of the results, we also replaced the original outcomes with scale-measured symptoms of depression and anxiety in the sensitivity analyses. In contrast to the primary result, this sensitivity analysis showed that SLP mediated the association between chronic pain and symptoms of depression and anxiety. This is consistent with the findings of Roya et al. [73]. Possible reasons were (1) the scale was only a rapid screening tool to identify individuals with symptoms of depression or anxiety, (2) the causal relationship between the mediator and the outcome was not considered.

This study has several strengths. To our knowledge, this is the first study using the compositional data analysis approach to address the role of 24-h movement behaviors in mental disorders related to chronic pain. Second, a large prospective cohort study of the UK Biobank with a long follow-up period was used, allowing us to obtain sufficient cases. Third, accelerometers were used for measuring physical activity, which can avoid self-reported bias. Last, the dose–response relationships between physical activity and mental health disorders were explored in the group with chronic pain, and detailed guidelines on how to allocate daily time to various activities were developed accordingly.

The study has also some limitations. First, this is an observational study, and causal relationships cannot be inferred from it. In future studies, it is necessary to determine whether increased physical activity, reduced sedentary behavior, and sufficient sleep can reduce the risk of chronic pain leading to mental disorders. Second, chronic pain status was only evaluated at baseline, but this could change over time. Third, we did not identify the effects of chronic pain at different or multiple sites. Fourth, we did not identify the effects of chronic pain on specific types of physical activity and mental disorders due to the lack of corresponding information. Fifth, though we used the E-value methodology to describe the impact of potential confounding factors, the bias from self-selection and unmeasured lifestyle factors remains a possibility. we cannot completely dismiss the likelihood that these factors may reverse the associations observed. Last, the accelerometer measures only the intensity of physical activity but cannot differentiate the specific types of activity, and there is also a controversy regarding the classification among MVPA, LPA, SB, and SLP. In light of the results of this study, these aspects deserve further study.

Conclusion

This study explored the role of 24-h movement behaviors in chronic pain and mental disorders, particularly how the changes related to chronic pain on 24-h movement behaviors would affect the incidence of mental disorders. Meanwhile, we further provided evidence-based recommendations for how people with chronic pain should allocate 24-h activity time. We believe that even patients with chronic pain should engage in appropriate moderate-to-vigorous physical activity and sleep duration should be extended while time in sedentary behavior should be reduced. Randomized controlled trials based on our recommendations are needed to determine whether such a time-use combination can prevent the development of mental disorders in individuals with chronic pain.