Introduction

Ensuring adequate sleep is essential for physical and cognitive health1,2,3,4. Normal human sleep consists of two phases—non-rapid eye movement (NREM) and rapid eye movement (REM). Any disturbance to these sleep episodes can result in poor sleep quality, which could lead to serious health issues, including chronic respiratory diseases5, mental health conditions6, musculoskeletal disorders7, cancer8 and even death9. Sleep problem is becoming an increasing global concern. The sleep-related agencies in main countries such as China (China Sleep Research Society), the United Kingdom (the Sleep Charity)10, and the United States (National Sleep Foundation)11 have reported high prevalence of poor sleep quality in general populations, which indicated that more than one in three people suffered from sleep issues12. Therefore, identifying and managing the risk factors for sleep disorders is crucial for alleviating the overall disease burden related to sleep.

Ambient temperature is known as an influencing factor for human sleep, whereas major gaps in knowledge remain13,14. First, several epidemiological studies15,16,17, including a global study over 7 million sleep records from 47,628 individuals across 68 countries18, have linked warmer temperature to impaired sleep. However, there is a paucity of evidence specifically from China, a country experiencing more pronounced climate change and sleep problems19,20,21, particularly at the national level. Second, previous studies have primarily utilized data of single-night sleep assessments or low time resolution, which may lead to diagnostic misclassification or errors, thereby attenuating the power of causal inference. In this regard, a repeated-measure design study is essential to enhance reliability and facilitate causal inference. Third, many prior studies rely on self-reported sleep data, which often introduce recall bias. Fourth, although an increasing number of studies utilized accelerometers to objectively record sleep duration, it is important to note that data from both self-reporting22 and accelerometers23 could not capture diverse sleep components. This limits comprehensive explorations into the impact of ambient average temperature on different sleep components. Finally, the global burden of sleep insufficiency in association with ambient temperature has been suggested to be heavier in an era of changing climate16,18. Yet, there is a dearth of evidence regarding the impact of climate change on different sleep compositions.

Therefore, we aimed to investigate the associations of ambient temperature with sleep duration and compositions utilizing nationwide repeated-measure dataset from the mobile atrial fibrillation application (mAFA) registry in China. The mAFA registry collected detailed and objective daily sleep information for more than 700,000 participants since the year 2021, utilizing the cardiopulmonary coupling (CPC) technique24 recently developed for Huawei smart devices based on photoplethysmography (PPG) signals. We further projected changes in sleep duration and composition loss associated with climate warming in different regions under various climate change scenarios. This research will offer valuable insights into the effects of climate warming on sleep duration and composition, providing new evidence to inform climate policies.

Results

Descriptive results

The present analysis includes 214,445 eligible participants (i.e., a randomly sampled 30% of the overall participants) from 336 cities at the prefecture level or above across mainland China from 2021 to 2023. We evaluated a total of 23,197,045 days of sleep monitoring with an average of approximately 108 days per participant. The average age was 39.2 years (standard deviation, SD = 12.8), and 36.0% had a body mass index (BMI) ≥ 25 kg·m−2.

Table 1 presents the descriptive statistics of the sleep-related indicators and environmental conditions (lag 0 d). During the study period, we identified 10,653,033 person-days with sleep insufficiency, accounting for 45.9% of all eligible monitoring days. The average total sleep duration was 427.3 minutes (SD = 86.5). On average, light sleep was 199.8 minutes (46.84%), deep sleep was 127.0 minutes (29.74%), and dream sleep was 100.4 minutes (23.42%). The average of 24-h mean temperature prior to wakening was 15.0 °C (SD = 10.1) and the averages of daily mean concentrations (lag 0 d) of particulate matter with an aerodynamic diameter <2.5 μm (PM2.5), nitrogen dioxide (NO2), carbon monoxide (CO), sulfur dioxide (SO2) and ozone (O3) were 32.8 μg/m³, 27.2 μg/m³, 0.66 mg/m³, 7.4 μg/m³, and 65.3 μg/m³, respectively.

Table 1 Descriptive statistics (mean and SD) on the sleep-related indicators and weather conditions during the 24 hours prior to waking

The association between daily average temperature and sleep parameters

Overall, higher temperatures were significantly associated with an increased risk of sleep insufficiency. As shown in Table 2, for each 10 °C increase of daily mean temperature at lag 0 d, the odds of sleep insufficiency increased by 20.1% (95% confidence intervals (CI): 19.9% to 20.3%). Figure S1 illustrated that the exposure–response relationship curve for daily mean temperature and the odds of sleep insufficiency was almost linear.

Table 2 The percentage change in odds of sleep insufficiency, changes (min) of sleep duration in different sleep stages and the changes (%) of sleep compositions associated with each 10 °C temperature increase at lag 0 d in the main analyses

Table 2 also summarizes the changes in sleep duration and its components. Higher temperatures were consistently and significantly associated with decreased sleep duration in different sleep stages. For each 10 °C increase in temperature (lag 0 d), total sleep duration decreased by 9.67 minutes (95% CI: 9.60 to 9.74), light sleep by 4.04 minutes (95% CI: 4.00 to 4.09), deep sleep by 3.58 minutes (95% CI: 3.55 to 3.62), and dream sleep by 2.01 minutes (95% CI: 1.99 to 2.04). Additionally, for the impact on sleep compositions, each 10 °C increase in temperature (lag 0 d) was associated with decrements in proportion of deep sleep (2.82%, 95% CI: 2.80–2.85%), dream sleep (2.20%, 95% CI:2.17–2.22%), and light sleep (2.02%, 95% CI: 2.00–2.05%). The exposure-response curves of the relationships between daily mean temperature and reduced sleep duration for different sleep stages were approximately linear (Figure S2).

The stratified analyses reveal meaningful differences in the temperature-sleep associations between subgroups classified by age, sex, BMI, and relative humidity (Table S1). The associations of high temperature with sleep insufficiency and sleep duration were consistently stronger among participants older than 45 years, women, those with a BMI ≥ 25 kg·m−2, and those simultaneously experiencing high humidity. The associations also differed appreciably at regional levels (Table S2). The percentage change in odds of sleep insufficiency in the East, Centre, South were higher than the national estimate, and the estimated sleep loss was more prominent in these regions.

Table S3 summarizes the results of all sensitivity analyses. The associations between ambient temperature and sleep insufficiency and sleep duration remained largely unchanged after excluding daytime sleep monitoring data. Moreover, the effect estimates remained robust after adjusting for five air pollutants in the main models. The estimates were also stable after simultaneously adjusting for napping and exercise. Additionally, after accounting for individual fixed effects rather than random effects, the results consistently demonstrated that higher ambient temperature had a detrimental impact on sleep sufficiency and sleep duration.

The sleep burden due to future climate warming

Figure S3 shows consistently increasing trends of projected annual-mean temperatures relative to the historical period under various climate change scenarios. The magnitude of increases differs by region with larger increments in the Northeast, Northwest, and North. Future climate warming would be more prominent in the SSP5-8.5 scenario (increase of 5.0 °C by the 2099) than in the SSP2-4.5 scenario (2.7°C) and the SSP1-2.6 scenario (1.8 °C) nationally. The differences of projected temperatures among the 3 scenarios become more apparent after the 2050 s.

Figure 1 shows the projected increases in sleep insufficiency related to high temperatures under three climate warming scenarios, relative to the historical period. There would be a consistent and drastic increase of sleep insufficiency cases throughout the century under the SSP5-8.5 scenario, while the trends would level off after the middle of the century under the SSP1-2.6 and SSP2-4.5 scenarios. Nationally, compared to the historical period, sleep insufficiency cases will increase by 2.93% to 3.05% in the 2030 s, 3.79% to 6.47% in the 2060 s, and 3.48% to 10.50% in the 2090 s per 1000 person-day under the three scenarios (Table S4). Notably, we projected 10.50% more cases of sleep insufficiency by the end of the 21st century under the high-emission scenario (SSP5-8.5) compared to the historical period. The increase in cases of sleep insufficiency will be larger in the Centre (12.89%; 95% empirical confidence intervals (eCIs): 12.62% to 13.16%), South (12.73%; 95% eCI: 12.38% to 13.08%), and East (12.29%; 95% eCI: 12.12% to 12.45%) compared to other regions in the 2090 s under SSP5-8.5.

Fig. 1: Projected percentage increments of sleep insufficiency associate with climate warming under different climate scenarios compared with the historical period (1985–2014), classified by region and period.
figure 1

The height of columns denotes the mean estimate and the vertical black lines represent their empirical 95% CIs computed from Monte Carlo simulations (1000 samples). Source data are provided as a Source Data file. SSP shared socioeconomic pathway, GCMs general climate models.

Figure 2 shows the projected total sleep loss per person-year due to future climate warming at the national and regional levels under the three scenarios. These trends are similar to those for the increasing excess cases of sleep insufficiency. Specifically, in the 2090 s, sleep loss due to climate warming is expected to increase by 10.96 hours (95% eCI: 10.76 to 11.15) under SSP1-2.6, 17.60 hours (95% eCI: 17.28 to 17.91) under SSP2-4.5, and 33.28 hours (95% eCI: 32.67 to 33.88) under SSP5-8.5 (Table S5). Notably, we projected 33 hours more total sleep loss per person-year by the end of the 21st century under the high-emission scenario (SSP5-8.5) compared to the historical period. Similarly, total sleep loss (hours) per person-year will be greater in the South (42.09; 95% eCI: 41.29 to 42.88), Centre (37.72; 95% eCI: 37.08 to 38.36), and East (34.64; 95% eCI: 34.26 to 35.03) compared to other regions in the 2090 s under SSP5-8.5. Figures S4-S6 show the projected light, deep, and dream sleep loss per person-year under the three scenarios. By the end of the 21st century under the high-emission scenario (SSP5-8.5), we projected 13 hours more light sleep loss, 12 hours more deep sleep loss, and 6 hours more dream sleep loss compared to the historical period (Tables S6-S8).

Fig. 2: Projected sleep loss (the decrement in total sleep hours) per person-year associated with climate warming under different climate scenarios compared with the historical period (1985–2014), classified by region and period.
figure 2

Source data are provided as a Source Data file. The height of columns denotes the mean estimate and the vertical black lines represent their empirical 95% CIs computed from Monte Carlo simulations (1000 samples). Source data are provided as a Source Data file. SSP shared socioeconomic pathway, GCMs general climate models.

As illustrated in Figs. 34, the magnitude of projected increases in excess cases of sleep insufficiency and decreases in total sleep duration would increase over time, but the magnitude varied, with the largest changes under the SSP5-8.5 scenario. The spatial distributions for the changes were similar in the 3 climate scenarios, but would considerably vary by cities with more evident increases for most cities in Centre, South, East and some cities in East. For the projected changes in sleep composition, the spatial differences were similar to those for total sleep duration, showing substantial differences in the magnitude of future burdens, particularly for deep sleep (Figs. S7S9).

Fig. 3: Projected percentage increments of sleep insufficiency associated with climate warming under different climate scenarios in 2030 s, 2060 s and 2090 s.
figure 3

Source data are provided as a Source Data file. SSP shared socioeconomic pathway.

Fig. 4: Projected total sleep loss (the decrement in total sleep hours) per person-year associated with climate warming under different climate scenarios in 2030 s, 2060 s and 2090 s.
figure 4

Source data are provided as a Source Data file. SSP shared socioeconomic pathway.

Discussion

This nationwide repeated-measure study demonstrates robust associations between higher ambient temperature and impaired sleep in the general population. We found that higher daily mean temperatures could reduce total sleep time and increase the odds of sleep insufficiency. We further found that elevated temperature could significantly affect sleep composition, particularly reduce the deep sleep duration and fraction. The adverse effects of high temperature on sleep were more pronounced in the elderly, women and individuals with obesity, and in high-humidity environments. As the climate warms, we predicted an increase in sleep deprivation and a decrease in sleep duration throughout this century, particularly under the high-emission scenario. The escalated sleep burden attributable to climate warming was not evenly distributed, and some geographic regions (South, Centre, East) would be more evidently affected.

Previous studies have consistently found a robust association between warmer temperatures and reduced sleep duration, regardless of geographical region, population, or the methods employed to measure sleep duration25,26,27. Minor and colleagues have further reinforced these findings through a global analysis encompassing over 7 million sleep records, revealing a notable decrease in sleep duration by 14.08 minutes (−10.61 to −17.55) in association with nighttime temperatures exceeding 30 °C18. Despite the accumulation of evidence, research specifically from China has been scarce. Until now, only a few studies28,29,30 with a limited sample size have examined the relationship between ambient temperature and sleep duration in single cities of China. In this regard, based on the largest-scale data in China to date, our study reveals an elevated likelihood of sleep insufficiency linked to higher temperatures. More importantly, we have enhanced the reliability of effect estimates through the inclusion of hourly temperature exposure data, objective sleep records, and a repeated-measure design. In addition, we found the association between temperature and sleep duration followed a monotonic exposure-response relationship throughout the exposure range, which is also supported by prior investigations16,18.

While the total amount of sleep time is a crucial metric, it is insufficient to fully define sleep health, as different sleep stages play distinct roles in physical recovery, memory consolidation, and emotional regulation. However, previous researches on environmental temperature and length of different sleep components (deep sleep, light sleep, and dream sleep) have been limited and inconclusive. For example, a field study of 48 participants in Sydney, Australia, reported that during the southern summer, as bedroom operative temperature increased by 1 K, the dream sleep percentage decreased by 1.65%31. A cross-sectional study of 5,204 participants with obstructive sleep apnea at a sleep center in Taipei, Taiwan, showed that higher temperatures were associated with an increase in the percentage of light sleep and deep sleep32. Additionally, a one-night study of 104 adults in Beijing reported there was no significant association between average indoor nighttime temperature during the transition season and proportion of sleep stages33. Our nationwide study provides the most comprehensive and convincing evidence yet that high temperature reduces the overall sleep duration primarily by shortening deep sleep, which is crucial for physical and functional restoration. This may provide important insights for preventing disorders in relation to disturbed deep sleep. Further research is warranted to validate our findings across different populations and regions, as well as to explore the mechanisms behind how climate affects various sleep stages.

The underlying mechanism of the association between higher temperature and poorer sleep, albeit uncertain, is biologically plausible. First, the body core temperature naturally drops during sleep34, which is important for initiating and maintaining sleep. However, high ambient temperatures can hinder this process by preventing effective lowering of body core temperature35, which could impact both the speed of falling asleep and the quality of sleep. Additionally, in hot environments, the body dissipates heat by sweating. Discomfort caused by sweating may result in frequent awakenings or difficulty in falling asleep36. Moreover, high temperatures may disrupt the circadian rhythm of body37, which regulates sleep and wake cycles, potentially causing insomnia or other sleep disorders. Additionally, discomfort and anxiety triggered by high temperatures can further disrupt sleep. High temperatures might also influence eating patterns38, physical activity patterns39,40 and metabolic function41, potentially causing quicker fatigue and increased nighttime discomfort.

Another significant contribution of our study is the projection of sleep burden due to future climate warming in China and the identification of notable spatial heterogeneity. Furthermore, we also projected the burden of impaired sleep compositions under varying climate scenarios for the first time. Previous projection studies applied a uniform exposure-response relationship for the entire country in estimating future total sleep loss and sleep insufficiency, neglecting the regional heterogeneity in exposure-response relationships. Our approach could have higher accuracy in the projection, because: (1) we derived city-specific daily temperature increases based on region-specific reference temperatures; (2) the region-specific exposure-response relationship was used; and (3) we computed and plotted city-level projections for sleep insufficiency, annual sleep loss, and different sleep stages. Our findings suggest that future climate warming may exacerbate sleep loss, especially under unrestricted emission scenario. We further found that sleep loss due to high temperature was larger in the South, Centre, and East compared to other areas, and the regional disparity would be amplified by future climate warming. This finding aligns with a prior global analysis18, which revealed that individuals residing in warmer climates tend to experience a greater reduction in sleep duration associated with temperature rise. The geographic inequality can be attributed to regional differences in baseline temperature-sleep associations and the magnitude of future warming. The temperature-sleep associations could be affected by a number of local factors, including climatic characteristics, socioeconomic characteristics and population vulnerability. Meanwhile, climate warming will amplify regional differences in climatic conditions, which will eventually result in larger spatial heterogeneity. However, it is important to note that our projections do not account for the possibility of future adaptations, which could potentially impact the magnitude of the temperature-sleep relationship.

Our study has important public health implications. First, given the considerable and increasing burden of sleep loss associated with higher temperatures, there is an urgent need for climate policies to reduce carbon emission in the future. Second, as deep sleep is the most affected sleep stage due to elevated temperatures, health issues stemming from insufficient deep sleep may become a focal point in the era of climate change, which warrants further investigations. Third, considering that climate change is projected to unequally erode sleep across various regions, it could be necessary to implement region-specific adaption policies. Fourth, in alignment with previous researches16,18, our findings indicate that older adults and women are more susceptible to temperature-related sleep loss, highlighting the importance of prioritizing protection for these vulnerable groups.

However, we should also acknowledge several limitations. First, despite incorporating an exceptionally large sleep monitoring dataset, our study population was confined to Huawei wearable users residing in Mainland China, which may restrict the generalizability of our findings to other populations. Second, exposure measurement errors were inevitable in the present study, because indoor temperature for each participant was not monitored and the prevalence of air conditioning for each participant was unknown; however, we believe that this type of exposure error tends to underestimate the true health effects of ambient temperature13, or merely widen the confidence intervals42. Future studies should strive to investigate the impact of the differences of indoor versus outdoor temperatures on sleep. Third, due to the data unavailability, we could not assess other potential confounding factors such as occupations; nevertheless, we believe this kind of residual confounding is not substantial in this repeated-measure design, because these factors are not likely to vary significantly between days. Fourth, although our sensitivity analysis supports the robustness of our results after adjusting for outdoor air pollutants, our study design could still not fully exclude the confounding effects of air pollution due to the time-varying exposure measurement errors that were related to personal behaviors such as opening the windows or using the air conditioning.

This nationwide repeated-measure study provides the most compelling evidence that rising ambient temperature could reduce sleep duration (particularly the deep sleep time) in China. We further projected that temperature-related sleep deprivation would continue to increase throughout this century under climate warming. Our findings highlight the importance of mitigating greenhouse gas (GHG) emission and implementing tailored adaptive measures for vulnerable regions and subgroups to alleviate the sleep deprivation and degraded sleep quality associated with climate warming.

Methods

Study population

This study used data from the mAFA registry by the PPG-based Huawei smart devices (Huawei Technologies Co.). The study received approval from the Central Medical Ethic Committee of Chinese People’s Liberation Army General Hospital (S2019–276–02). The Scientific Life Intervention Research project was launched in 2021. All individuals possessing compatible smart devices can freely download this application from the Huawei Appstore, and it can monitor heart rate, exercise and sleep. We recruited users who volunteer to participate in this project and provide electronic informed consent. Participants were also asked to complete an online questionnaire to provide information on their age, sex, height, weight, residential address. This study adheres to the principles of the Declaration of Helsinki. We excluded individuals outside of mainland China, and those having incomplete address information or fewer than 7 days of eligible sleep monitoring. Sleep apnea is known to significantly affect sleep quality and be associated with other chronic diseases, which may induce heterogeneity between those with this condition and the general population. Therefore, we also excluded individuals with sleep apnea risk to enhance the generalizability of our findings. The risk monitoring for sleep apnea using smart devices43. During the study period, there were 726,444 eligible participants with 71,170,236 effective sleep monitoring days available in this project from March 2021 to November 2023. However, due to huge computational burden, we only randomly extracted about 30% of these participants for this analysis according to the computation capacity of our server. In total, 214,445 users aged 18 or older with 23,197,045 eligible monitoring days were included. This sample size is significantly larger than those typically observed in similar studies28,29,30. Additionally, only anonymous data were used for the present analysis.

Sleep monitoring data

Each participant was asked to install a custom-designed mobile app in the Huawei smart device (Huawei Technologies Co.). Relevant signals were transmitted through Bluetooth to the HUAWEI Research cloud space via the mobile app. The Huawei smart device (Huawei Technologies Co.) contained multiple sensors, including an accelerometer (ACC), a gyroscope sensor, and optical sensors based on a photoplethysmography (PPG) algorithm. PPG signals measure local variations in blood volume in tissues, reflecting the peripheral pulse modulated by heart activity, respiration, and other physiological effects. An ACC is a movement detector incorporated into the smart devices to measure movement, including duration/frequency, amplitude/strength, and acceleration/speed44.

For sleep monitoring, sleep onset and cessation time points for night-time sleep are determined from the ACC and PPG signals. Motion-related features are extracted to categorize the user’s activity level, and combined with heart rate trend analysis to identify sleep and wake times. Conventional sleep stages include REM sleep and NREM sleep45. Stages 1–4 of NREM sleep indicate the increasing sleep depth. Stages 1 and 2, represent light sleep; and in comparison, stages 3 and 4 specifically represent deep sleep46. REM sleep specifically denotes dream sleep. To monitor sleep structure, breath-to-breath respiratory dynamics and beat-to-beat intervals (R-R intervals) are extracted from heart rate data obtained via PPG signals47. Based on previously reported methods48, further indicators for different sleep stages were identified using CPC24 based on PPG signal. The CPC48,49 algorithm calculated the product of the cross-spectral powers of these two signals by employing Hilbert-Huang Transform (HHT)50,51 analysis, which facilitates the analysis of various sleep stages, including deep sleep, light sleep, rapid eye movement (REM), and wakefulness. Notably, this technology has been certified by Food and Drug Administration (FDA) and China Food and Drug Administration (CFDA), which has high accuracy and gradually been widely used52,53,54. Sleep insufficiency was defined as less than 7 hours of sleep during one night55,56, and total sleep duration was the sum of time for light sleep, deep sleep, and dream sleep.

Exposure assessment

Meteorological data (i.e., temperature, relative humidity) were obtained from ERA5-Land (the fifth-generation European Centre for Medium-Range Weather Forecasts atmospheric reanalysis of the global climate) with 0.1° × 0.1° spatial and hourly temporal resolutions. To allow for the adjustment of concomitant exposures to air pollutants, we also obtained hourly mean concentrations of air pollutants including PM2.5, SO2, NO2, CO, and O3 from China’s National Urban Air Quality Real-time Publishing Platform (https://air.cnemc.cn:18007/). The exposure levels of environmental factors for each participant were determined by assigning data from the nearest monitoring station or grid cell based on the center of the residential district for privacy reasons. For each participant, we calculated the average temperature, average relative humidity, and mean concentrations of air pollutants for a duration of 24 h before his or her awakening time to represent the exposure levels on the concurrent day (lag 0 d). We computed the maximum 8-h averages prior to awaking for O3 exposure at lag 0 d.

Projection of temperature

We acquired daily mean temperature data projected by 15 general circulation models (GCMs) from the National Aeronautics and Space Administration (NASA) Earth Exchange Global Daily Downscaled Projections dataset for the period 1985 to 2099. The SSPs correspond to the increasing trajectories of atmospheric GHG concentrations and characterize a range of warming scenarios in global climate from mild to extreme57. For this study, we specifically chose three shared socioeconomic pathway scenarios as strict (SSP1-2.6), medium (SSP2-4.5), and unrestricted (SSP5-8.5) GHG emissions. For example, the SSP5-8.5 scenario implies unlimited energy consumption, GHG emissions, and population growth58. By linking residential coordinates with grid cells within the dataset, we extracted simulated daily temperature data for each city. Subsequently, the obtained temperature data were calibrated with the ERA5 data using the bias-correction method59.

To compute the daily temperature changes for future projections, we first obtained the projected daily temperatures during the historical period (1985 to 2014) from 15 GCMs under historical scenarios. According to the previous method60, we then computed the historical temperature by averaging the daily temperatures for each calendar day over the historical period (i.e., the mean of daily temperature in each same calendar day between 1985 and 2014). Then, we calculated the differences of projected daily temperature in each day of the projection period (January 1, 2015–December 31, 2099), compared to the corresponding historical temperature for the same calendar day.

Statistical analyses

Analyses on the association between daily temperature and sleep

Under a linear assumption, we applied the generalized linear model to quantify the association between ambient temperature and sleep insufficiency, and the linear mixed-effect model61,62 to evaluate the associations between temperature and sleep length and its compositions (i.e., continuous duration of different sleep stages). To account for within-individual correlations across repeated measurements, we added a random-effect intercept for each participant63,64. The covariates in the main models included: (1) demographic characteristics [age, sex and body mass index (BMI)]; (2) an indicator variable of “year” to adjust for long-term trends; (3) an indicator variable of “day of the week” to adjust for the influences of varied sleep status within one week; (4) a natural spline of daily mean relative humidity (lag 0 d) with 3 degrees of freedom; (5) a binary variable of public holidays; (6) an indicator variable of region (East, Center, South, Southwest, North, Northeast and Northwest)65 to reflect the spatial variation of climatic and geographic characteristics in China; and (7) an indicator variable of four seasons to adjust for the potential confounding effects of season-related factors: spring (March-May), summer (June-August), autumn (September-November), and winter (December-February).

To flexibly plot the exposure-response relationship curves, we ran the above main models using restricted cubic splines with three knots for temperature. For sleep insufficiency, the estimated odds ratio was transformed into the percentage change in odds associated with each 10 °C increase in 24-h mean temperature prior to awaking, which was calculated using the following formula: (\({e}^{\beta \times 10}\) − 1) × 100%66. For sleep duration (min) and the median duration in various sleep stages, the absolute changes were presented as \({{\rm{\beta }}}\). The \({{\rm{\beta }}}\) is the regression coefficient from the main models for corresponding outcomes.

Besides, we conducted several stratified analyses by sex (male and female), age (<45 years and ≥45 years), BMI ( < 25 kg·m−2 and ≥25 kg·m−2), and relative humidity (High and Low, classified by the median). The statistical significance of the between-stratum differences for the effect estimates was tested using the following formula.

$$({{{\rm{\beta }}}}_{1}-{{{\rm{\beta }}}}_{2})\pm 1.96\times \sqrt{{{{\rm{SE}}}}_{1}^{2}+{{{\rm{SE}}}}_{2}^{2}}$$
(1)

where \({{{\rm{\beta }}}}_{1}\) and \({{{\rm{\beta }}}}_{2}\) are the mean effect estimates for the two subgroups, and \({{{\rm{SE}}}}_{1}\) and \({{{\rm{SE}}}}_{2}\) are their respective standard errors.

In addition, we conducted several sensitivity analyses to verify the robustness of our findings. First, we excluded daytime sleep data, which was defined as those falling asleep after 03:00 and waking up after 11:0067. Second, since air pollutants could be linked to both ambient temperature68,69 and sleep70,71, they may serve as confounders in our analyses. Consequently, consistent with many previous epidemiological studies of ambient temperature72,73, we performed a sensitivity analysis by additionally adjusting for air pollutants (i.e., PM2.5, SO2, NO2, CO, and O3) simultaneously in our models to assess the robustness of our main results. Third, we controlled for the potential confounding effects of napping (i.e., whether there was a nap at noon) and exercise (i.e., the number of steps taken that day) in the main models, respectively. Last, we re-analyzed the data by employing a multivariate, fixed-effects panel model18.

Analysis on the sleep burden associated with future climate change

We estimated the burden of sleep insufficiency and sleep loss associated with future climate warming, assuming no adaptation or population changes. Firstly, we calculated the excess cases of sleep insufficiency associated with temperature increase in each city as follows65,74:

$${{Excess\; Cases}}_{{ci}}={{Pop}}_{{ci}}\times {{Rate}}_{{ci}}\times {{ERC}}_{co}\times {\Delta T}_{{ci}}$$
(2)

where \({{Excess\; Cases}}_{{ci}}\) indicates the sleep insufficiency cases in relation to daily average temperature increase at the city level, \({{Pop}}_{{ci}}\) is the mean of the city population size at 2000–2010, \({{Rate}}_{{ci}}\) signifies the mean of baseline daily sleep insufficiency prevalence in the corresponding city, \({{ERC}}_{{co}}\) denotes the corresponding percentage change in odds of sleep insufficiency for a 1 °C increment in temperature, and \({\Delta T}_{{ci}}\) represents the change in future daily average temperature compared to the historical period (1985–2014) at the city level. Secondly, we totaled the excess cases of sleep insufficiency associated with one-degree increase of daily average temperature for each city annually. Thirdly, we calculated the excess cases of sleep insufficiency separately for each city and for each combination of GCMs and SSPs. We then computed the excess cases of sleep insufficiency as GCM-ensemble averages by city, decade, and SSP. We then aggregated the city-specific excess cases of sleep insufficiency to derive the national and regional projections. We used Monte Carlo simulations to obtain 95% eCIs, so as to quantify the uncertainty in both the estimation of the exposure-response associations and climate projections across GCMs. Finally, we assessed the burden of sleep insufficiency associated with future climate warming as the percentage change from the historical period.

We also projected the loss of total sleep and its composition (i.e., the decrement in total sleep duration, light sleep, deep sleep and dream sleep) associated with temperature increase at city, regional, and national levels. The corresponding formula is:

$${S{leep}\,L{oss}}_{{ci}}={{Pop}}_{{ci}}\,\times \,{\Delta D{uration}}_{{co}}\times {\Delta T}_{{ci}}$$
(3)

where \({S{leep}{L}{oss}}_{{ci}}\) indicates the sleep loss in relation to daily average temperature increase at the city level, \({{Pop}}_{{ci}}\) is the mean of the city population size from 2000 to 2010, \({\Delta D{uration}}_{{co}}\) represents the region-specific decrement of total sleep duration for a 1 °C increment in temperature and \({\Delta T}_{{ci}}\) represents the change in future daily average temperature compared to the historical period (1985–2014) at the city level. The subsequent steps are similar to the estimation of sleep insufficiency burden. Finally, we calculated the sleep loss burden due to climate change as the reduction of sleep hours per person per year at city, regional, and national levels.

The above statistical analyses were performed using R software (version 3.6.3). We conducted regression analyses using the glm and lme4 packages, and performed bias-correction processes using the hyfo package. All the statistical tests were two-sided, and P values less than 0.05 indicated statistical significance.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.