Abstract
Background:
Total knee replacement (TKR) is the primary treatment for advanced osteoarthritis, but its impact on postoperative sleep disorders remains unclear. This study investigates the association between TKR and new-onset obstructive sleep apnea (OSA) and insomnia.
Method:
A retrospective cohort study was conducted using the TriNetX US Collaborative Network. Adults (⩾18 years) diagnosed with osteoarthritis who underwent TKR were propensity-matched 1:1 to non-TKR controls based on demographics, comorbidities, and medication use. The primary outcomes were new-onset OSA and insomnia, assessed using Cox proportional hazard models with hazard ratios (HRs) and 95% confidence intervals (CIs). Sensitivity and stratification analyses were performed to validate findings.
Results:
TKR patients had a significantly higher risk of OSA (HR: 1.71, 95% CI: 1.50–1.95 at 1 year; HR: 1.36, 95% CI: 1.28–1.44 at 5 years) and insomnia (HR: 1.55, 95% CI: 1.32–1.82 at 1 year; HR: 1.22, 95% CI: 1.13–1.31 at 5 years). Sensitivity analyses confirmed robustness across different propensity-matching methods and washout periods. Stratification showed higher risks in older adults (⩾65 years: HR: 1.40 for OSA, 1.32 for insomnia) and females (HR: 1.49 for OSA, 1.27 for insomnia).
Conclusion:
TKR increases the long-term risk of OSA and insomnia, particularly in older and female patients. Clinicians were recommended to monitor postoperative sleep health to improve recovery outcomes.
Plain language summary
We looked at whether people who had total knee replacement (TKR) surgery were more likely to develop sleep problems, such as insomnia and obstructive sleep apnea (OSA), compared to those who didn’t have the surgery. To do this, we used a large U.S. health database that includes information on over 80 million people.
We compared two groups: 30,580 people who had knee replacement surgery and another 30,580 who did not, making sure both groups were similar in age, gender, health conditions, and other factors. We followed them for up to five years to see who developed sleep disorders after surgery. We found that people who had TKR were more likely to develop insomnia and sleep apnea at 1, 3, and 5 years after the surgery. This higher risk was seen in both men and women and across different age groups. Even when we used different ways to double-check the results, the increased risk remained. We believe this may be due to ongoing pain, stress, or other issues that can happen after surgery and affect sleep. Poor sleep can make recovery harder and reduce overall quality of life.
Our findings suggest that doctors should keep an eye on sleep problems in patients after knee replacement surgery. Catching and treating these issues early could help people recover better. We hope future studies will explore the reasons behind this link and how to prevent sleep problems after surgery.
Introduction
Obstructive sleep apnea (OSA) is characterized by partial or complete airway obstruction, leading to substantial physiological disruptions and diverse clinical consequences. 1 An estimated 3% of women and 10% of men aged 30–49 are affected by OSA, with the prevalence increasing to 9% in women and 17% in men aged 50–70. 2 Common signs and symptoms include loud or irregular snoring, obesity, daytime sleepiness, poor sleep quality, and breathing interruptions during sleep. 3 OSA is an independent risk factor for severe complications, including hypertension, coronary artery disease, atrial fibrillation, heart failure, stroke, and diabetes, contributing to a significant health burden and a vicious cycle that makes it a critical condition requiring attention.3,4
For OSA, established risk factors include male sex, older age, obesity, and craniofacial abnormalities.3,5 The impact of surgery on the prevalence of OSA has been less frequently studied. However, some studies have shown that surgery is a significant factor affecting sleep quality.6–8 Among various surgical procedures, studies have indicated that total knee replacement (TKR) significantly impacts postoperative sleep quality, contributing to insomnia through mechanisms such as postoperative pain, chronic pain, and arthrofibrosis.9,10
While previous studies have described transient sleep disturbances following total knee replacement, most have focused on short-term outcomes and have not specifically addressed the long-term risk of clinically diagnosed OSA or insomnia using large-scale real-world data.11–13 Moreover, existing literature often lacks comparator groups and relies on subjective sleep assessments without accounting for baseline comorbidities or medication use.14,15 Given the increasing global burden of osteoarthritis and the rising volume of TKR procedures, 16 understanding potential downstream complications such as sleep disorders is critical for postoperative care and health resource planning. To address this gap, we conducted a retrospective study utilizing the TriNetX US Collaborative Network to evaluate the risk association between TKR, OSA, and insomnia through data analysis. Our findings aim to serve as a clinical reference, enhancing awareness of post-TKR sleep disorder risks and advocating for early interventions to mitigate associated cardiovascular complications.
Methods
Data source
The current study employed a retrospective cohort design using data from the TriNetX Research Network—a global platform that collects de-identified and continuously updated electronic health records from a variety of healthcare institutions. For this analysis, we focused on the U.S. subset of TriNetX (the U.S. collaborative network), which gathers information from over 60 American healthcare organizations and includes records for more than 80 million patients. This resource has been applied in epidemiological studies across multiple clinical disciplines.17–19 The specific administrative codes used for patient identification are detailed in Table S1. The reporting of this study conforms to the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) statement 20 (Table S2).
Inclusion and exclusion criteria
We selected individuals diagnosed with osteoarthritis between January 2005 and December 2017. Among these patients, those who received a TKR were set as TKR group, while those without any record of TKR prior to the index date served as non-TKR controls. Individuals with preexisting sleep disorders, cancer diagnoses, those under 18, or who died before the index date were excluded from the analysis.
Outcomes and matching covariates
The primary outcome was the development of new sleep disorders—specifically OSA and insomnia. To address potential baseline imbalances between the TKR and control groups, we implemented propensity score matching using a greedy-nearest neighbor algorithm with a caliper of 0.1 standard deviations. Matching criteria included variables such as age at index, sex, race, body mass index, a range of comorbidities (e.g., diabetes, hypertension, ischemic heart disease, cerebrovascular disease, hyperlipidemia, vitamin D deficiency, chronic kidney disease), medication use (antidepressants, glucocorticoids, beta blockers, opioid analgesics), smoking, alcohol and substance use, socioeconomic status, type of healthcare service (inpatient and ambulatory), and laboratory measures like C-reactive protein (CRP). To mitigate potential biases from overmatching, sensitivity analyses were performed with various matching algorithms, and different washout periods were applied to exclude early events that could confound the results. Additionally, subgroup analyses by age, sex, and smoking status were carried out to further understand the impact of TKR on subsequent sleep disorders. In all cases, Cox proportional hazards models were used to calculate hazard ratios (HRs) comparing the risk between groups.
Statistical analyses
All statistical analyses were conducted using the analytics function within the TriNetX platform. HRs along with their 95% confidence intervals (CIs) were computed to evaluate the risk of developing sleep disorders in the TKR group relative to the control group. Baseline differences between the groups were quantified using the standardized mean difference (SMD), with values above 0.1 indicating a significant difference.
Results
Study population and baseline characteristics
After propensity score matching, we selected 30,580 eligible patients in each of the TKR and non-TKR groups for further analysis (Figure 1). The age difference between the TKR group (64.8 ± 10.6 years) and the non-TKR group (60.7 ± 15.0 years) was statistically significant, with a SMD of 0.32 before matching. Both groups were predominantly female, with 62.5% in the TKR cohort and 59.9% in the control cohort. After matching, whites accounted for more than 70% of patients, while approximately 10% were Black and 3.5% were Asian. Covariates for the two groups—including common comorbidities, socioeconomic status, medical utilization, and co-medications (such as antidepressants, glucocorticoids, beta-blockers, and opioids that may interfere with sleep performance)—were balanced after the matching process (Table 1).

Patient selection flowchart.
Baseline characteristics of study subjects (before and after propensity score matching).
Propensity score matching was performed on age at index, sex, race, body mass index, status of comorbidities (diabetes mellitus, hypertension, ischemic heart diseases, cerebrovascular diseases, hyperlipidemia, vitamin D deficiency, chronic kidney disease), status of comedication use (antidepressants, glucocorticoids, beta-blockers, opioid analgesics), status of smoking, alcoholism and substance use, socioeconomic issues, medical utilization status (inpatient, ambulatory), lab data (CRP).
Risk of sleep disorders in TKR patients
Osteoarthritis patients undergoing TKR exhibit a significantly elevated risk of developing sleep disorders compared to matched controls. The Kaplan–Meier plot were presented in Figures S1–S3. Specifically, the HRs for OSA was 1.71 (95% CI, 1.50–1.95) at 1 year, 1.96 (95% CI, 1.33–2.89) at 3 years, and 1.36 (95% CI, 1.28–1.44) at 5 years postoperatively. Similarly, the risk for insomnia was significantly higher with HRs of 1.55 (95% CI, 1.32–1.82) at 1 year, 1.81 (95% CI, 1.05–3.13) at 3 years, and 1.22 (95% CI, 1.13–1.31) at 5 years. When considering overall sleep disorders, the HRs were 1.58 (95% CI, 1.43–1.75), 2.03 (95% CI, 1.49–2.76), and 1.26 (95% CI, 1.20–1.32) at 1, 3, and 5 years, respectively (Table 2). Sensitivity analyses further confirmed the robustness of our findings. In the sensitivity analysis based on different propensity score matching models (Table 3), the association between TKR and the risk of sleep disorders remained significant across all models. HRs for OSA ranged from 1.27 (95% CI, 1.20–1.34) to 1.47 (95% CI, 1.41–1.53), for insomnia from 1.18 (95% CI, 1.10–1.27) to 1.34 (95% CI, 1.28–1.41), and for overall sleep disorders from 1.18 (95% CI, 1.13–1.24) to 1.36 (95% CI, 1.32–1.40). In sensitivity models using varying washout periods (Table 4), the association remained. For OSA, the HRs were 1.35 (95% CI, 1.27–1.44) at a 12-month washout, 1.38 (95% CI, 1.29–1.47) at 24 months, and 1.42 (95% CI, 1.32–1.52) at 36 months. For insomnia, the corresponding HRs were 1.20 (95% CI, 1.12–1.30), 1.21 (95% CI, 1.11–1.32), and 1.17 (95% CI, 1.06–1.28), while for overall sleep disorders, the HR were 1.25 (95% CI, 1.19–1.31), 1.27 (95% CI, 1.20–1.34), and 1.28 (95% CI, 1.21–1.36), respectively.
Risk of overall sleep disorders under different follow-up time.
Data present here were the value of follow-up from 90 days after index date to the respective following up years.
Propensity score matching was performed on age at index, sex, race, body mass index, status of comorbidities (diabetes mellitus, hypertension, ischemic heart diseases, cerebrovascular diseases, hyperlipidemia, vitamin D deficiency, and chronic kidney disease), status of comedication use (antidepressants, glucocorticoids, beta-blockers, and opioid analgesics), status of smoking, alcoholism and substance use, socioeconomic issues, medical utilization status (inpatient, ambulatory), lab data (CRP).
Sensitivity analysis: risk of sleep disorders in total knee replacement patients based on different covariate matching models, with 5-year follow-up.
Propensity score matching was performed on age at index, sex.
Propensity score matching was performed on age at index, sex, and comedications (antidepressants, glucocorticoids, beta-blockers, and opioid analgesics).
Propensity score matching was performed on age at index, sex, race, body mass index, and socioeconomic status.
Sensitivity analysis: risk of sleep disorders in total knee replacement patients with different washout periods.
Incident events occurred within each washout period were excluded in the corresponding analysis, following up for 5 years after index date.
Propensity score matching was performed on age at index, sex, race, body mass index, status of comorbidities (diabetes mellitus, hypertension, ischemic heart diseases, cerebrovascular diseases, hyperlipidemia, vitamin D deficiency, and chronic kidney disease), status of comedication use (antidepressants, glucocorticoids, beta-blockers, opioid analgesics), status of smoking, alcoholism and substance use, socioeconomic issues, medical utilization status (inpatient, ambulatory), lab data (CRP).
Stratification analysis
Stratification analyses further demonstrated that the increased risk of sleep disorders in TKR patients was consistent across different subgroups. In Table 5, for new-onset insomnia, the HR was 1.15 (95% CI, 1.01–1.32) in males and 1.27 (95% CI, 1.16–1.39) in females, while for new-onset OSA the HRs were 1.37 (95% CI, 1.25–1.50) in males and 1.49 (95% CI, 1.37–1.62) in females. When stratified by age, the HR for new-onset insomnia was 1.29 (95% CI, 1.08–1.54) for patients aged 18–64 years and 1.32 (95% CI, 1.22–1.43) for those aged ⩾65 years; similarly, for new-onset OSA the HR was 1.30 (95% CI, 1.13–1.49) in the younger group versus 1.40 (95% CI, 1.31–1.50) in the older group. Consistent results were observed for overall sleep disorders (Table 6), with HRs of 1.25 (95% CI, 1.15–1.35) in males and 1.34 (95% CI, 1.26–1.42) in females, and HRs of 1.25 (95% CI, 1.12–1.40) and 1.32 (95% CI, 1.25–1.39) in patients aged 18–64 and ⩾65 years, respectively. In the stratified analyses based on smoking history, the association between TKR and sleep disorders remained consistent. For new-onset OSA, the HR was 1.43 (95% CI, 1.14–1.79) among patients with documented smoking and 1.39 (95% CI, 1.32–1.47) among those without. For insomnia, the HR was 1.24 (95% CI, 0.95–1.60) in smokers and 1.27 (95% CI, 1.18–1.36) in nonsmokers. For overall sleep disorders, the HRs were 1.25 (95% CI, 1.04–1.49) and 1.30 (95% CI, 1.25–1.36), respectively. These findings suggest that the increased risk of sleep disorders after TKR is evident regardless of smoking history.
Stratification analysis of insomnia and obstructive sleep apnea risk in total knee replacement patients.
Follow-up time was set as 5 years after index date. Incident cases occurring within 3 months after index date would be excluded from analysis. Propensity score matching was performed on age at index, sex, race, body mass index, status of comorbidities (diabetes mellitus, hypertension, ischemic heart diseases, cerebrovascular diseases, hyperlipidemia, vitamin D deficiency, and chronic kidney disease), status of comedication use (antidepressants, glucocorticoids, beta-blockers, and opioid analgesics), status of smoking, alcoholism and substance use, socioeconomic issues, medical utilization status (inpatient, ambulatory), lab data (CRP). Boldfaced values in this table indicates that the hazard ratio is statistically significant.
Stratification analysis of overall sleep disorders risk in total knee replacement patients.
Follow-up time was set as 5 years after index date. Incident cases occurring within 3 months after index date would be excluded from analysis. Propensity score matching was performed on age at index, sex, race, body mass index, status of comorbidities (diabetes mellitus, hypertension, ischemic heart diseases, cerebrovascular diseases, hyperlipidemia, vitamin D deficiency, and chronic kidney disease), status of comedication use (antidepressants, glucocorticoids, beta-blockers, and opioid analgesics), status of smoking, alcoholism and substance use, socioeconomic issues, medical utilization status (inpatient, ambulatory), lab data (CRP).
Discussion
The current study demonstrates that patients undergoing TKR have a significantly elevated risk of developing sleep disorders, including OSA and insomnia, compared to those who do not receive TKR. After adjusting for potential confounders using propensity score matching, stratifying by age and sex, and excluding incident sleep disorder cases identified within 1–5 years postsurgery, the increased risk remains robust. These findings underscore the clinical importance of vigilant monitoring and management of sleep-related complications in the post-TKR patient population.
The research reveals the association between TKR and sleep disorders. Osteoarthritis itself can affect sleep through pain catastrophizing and arthritis self-efficacy, as well as depressive symptoms, reduced physical activity, and poor mental health.21,22 TKR may further impact sleep due to factors such as postoperative pain, chronic pain, arthrofibrosis, aseptic loosening, component malpositioning, nerve damage, and psychological factors.9,10 A retrospective study also reported that after TKR, 75.9% of patients had primary insomnia, while 24.1% had secondary insomnia, with adaptive sleep disorder being the most prevalent in first 2 month. 23 A meta-analysis suggested, compared to robotic-assisted surgery, manual surgery is more likely to affect patients’ sleep quality but is associated with lower levels of pain and anxiety. 24 These findings suggest that TKR has a significant impact on insomnia and OSA, underscoring its clinical importance.
The impact of the postoperative period following TKR on sleep varies across studies. Some observational studies have found that insomnia symptoms worsen significantly and peak around 6 weeks (1–2 months) postoperatively, followed by gradual improvement within the next 6 weeks, though often incomplete.11,12,14,23,25–28 Another systematic review indicated that TKR was associated with improved sleep quality 6 months postoperatively. 13 Nevertheless, despite subgroup analyses and exclusions, TKR remains a significant risk factor for insomnia and OSA in our study. Conversely, sleep also plays a crucial role in postoperative recovery after TKR. Improving perioperative sleep quality and duration significantly reduces early postoperative pain after TKR, thereby decreasing the overall analgesic requirement.29,30 Multimodal analgesia, particularly with acetaminophen and nonsteroidal anti-inflammatory drugs, is effective in managing chronic postoperative pain.31,32 However, there is no consensus on the optimal treatment approach. 32
Patients with untreated or subclinical OSA exhibit persistent systemic inflammation with elevated interleukin-6, tumor necrosis factor-α, C-reactive protein, and oxidative stress from intermittent hypoxemia, which together promote endothelial dysfunction and increase cardiovascular vulnerability. 33 TKR imposes an acute inflammatory load, with postoperative surges of interleukin-6 and C-reactive protein documented in the first hours to days after surgery.34,35 The immediate postoperative period frequently includes reduced mobility, which could potentially exacerbates systemic inflammatory cascades and impairs respiratory mechanics. 36 Moreover, opioid based analgesia can suppress ventilatory drive, blunt arousal to hypoxemia, and prolong nocturnal oxygen desaturation by μ-opioid receptor mediated depression of the respiratory control system. 37 When the baseline inflammatory state of OSA converges with the perioperative inflammatory response to surgery, upper airway collapsibility may be intensified, and recovery of nocturnal oxygen saturation may be delayed.38,39 This interaction is clinically important because the cascade caused by OSA could potentially be associated with postoperative desaturation, cardiac events, and other adverse outcomes after joint arthroplasty.40,41 Accordingly, patients with known or suspected OSA who are undergoing TKR warrant vigilant monitoring.
Limitations of the current study should be noted. First, we relied on ICD-10-CM codes for both patient identification and outcome assessment. However, the use of administrative codes may compromise diagnostic accuracy, as it is not possible to confirm whether the diagnoses of OSA or insomnia were made by relevant specialists such as sleep medicine physicians, psychiatrists, or otolaryngologists. Furthermore, polysomnography or other validated diagnostic instruments, which represent the clinical gold standard for OSA, were not available in the TriNetX database. These limitations raise the possibility of underreporting, misclassification, and diagnostic inaccuracy, especially for insomnia, which is frequently underrecognized in electronic health records. In addition, perioperative symptoms such as pain-related sleep disruption may further confound the identification of true insomnia cases. Second, the severity of osteoarthritis may differ between TKR and non-TKR patients, with those undergoing TKR likely having more advanced disease, potentially influencing the risk of subsequent sleep disorders. However, due to the lack of relevant data, this study could not precisely stratify osteoarthritis severity, which remains a limitation for future consideration. Third, as this study utilized the TriNetX database, most patients were White, with fewer Asian individuals. Regional and racial generalizability remains to be determined. Fourth, as a retrospective study, causal relationships could not be definitively established. Furthermore, despite extensive adjustments through propensity score matching, residual confounding cannot be entirely excluded. Key clinical variables such as undiagnosed or subclinical OSA, preoperative sleep assessments, longitudinal changes in body mass index, severity grading of osteoarthritis, and individualized rehabilitation practices were not available in the TriNetX dataset. Although smoking status was incorporated into both the matching and stratification models, the absence of time-specific information precluded us from distinguishing between preoperative and postoperative smoking behaviors, which may limit interpretation of its temporal relationship with sleep disorder development. In addition, the lack of postoperative physiological data such as fluid balance, systemic inflammation, and tissue edema prevented assessment of fluid-related upper airway collapsibility, a factor particularly relevant in patients with undiagnosed or borderline OSA. Detailed perioperative parameters including inflammatory markers, fluid administration records, and body positioning during recovery were not captured in the database. These unmeasured factors may have influenced the observed associations and should be examined in future prospective studies to strengthen causal inference. Fifth, genetic predisposition may also contribute to inter-individual variability in OSA risk but could not be evaluated in our study. Specific gene variants related to craniofacial structure (such as PRDM16 and PAX1), obesity-related pathways (fat mass- and obesity-associated gene, FTO; leptin receptor, LEPR), and serotonergic neuromodulation (SLC6A4, TPH2) have been implicated in OSA susceptibility. As the TriNetX platform does not include sufficient genomic data, we were unable to account for inherited risk factors. Sixth, although we used Cox proportional hazards models to estimate relative risks, the proportional hazards assumption could not be formally tested due to constraints in the TriNetX analytics platform, which does not provide tools such as Schoenfeld residual testing. Seventh, postoperative drug exposure, including opioids, benzodiazepines, and muscle relaxants, was not captured in our dataset and therefore could not be included as covariates. These medications are known to influence upper airway muscle tone and central respiratory drive, potentially contributing to the development or exacerbation of sleep-disordered breathing. As the TriNetX platform only includes medication data prior to the index date, we were unable to assess dynamic postoperative pharmacologic effects. Although baseline use of opioid analgesics and other sleep-influencing medications was adjusted for in our models, future studies incorporating detailed perioperative drug exposure and dosage information are warranted to further delineate the role of postsurgical medication in sleep outcomes.
Conclusion
Our study reveals a significant increase in the risk of insomnia and sleep apnea at 1, 3, and 5 years post-TKR. These sleep disorders may reduce patients’ quality of life and, in turn, affect postoperative outcomes and recovery. Based on our findings, clinicians may monitor patients’ sleep conditions postoperatively and initiate early diagnosis and treatment when necessary. Future prospective studies are required to explore the underlying mechanisms and pathways linking TKR and sleep disorders. Integrating postoperative rehabilitation strategies will be essential to optimize patient outcomes.
Supplemental Material
sj-docx-1-tab-10.1177_1759720X251384581 – Supplemental material for New-onset obstructive sleep apnea and insomnia after total knee replacement in patients with osteoarthritis: real-world evidences
Supplemental material, sj-docx-1-tab-10.1177_1759720X251384581 for New-onset obstructive sleep apnea and insomnia after total knee replacement in patients with osteoarthritis: real-world evidences by Shuo-Yan Gau, Hsiang-En Tsai, Hui-Chin Chang, Chih-Lung Wu and Shiu-Jau Chen in Therapeutic Advances in Musculoskeletal Disease
Footnotes
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
