Authors: Weiwei Su, Chunguang Liang, Jinrui Fei, Ying Ma, Shuxin Guo, Qiushi Yang
Categories: Article, Obstructive sleep apnea, Resistant hypertension, Random forest, Risk prediction model, Diseases, Cardiovascular diseases, Hypertension
Source: Scientific Reports
Authors: Weiwei Su, Chunguang Liang, Jinrui Fei, Ying Ma, Shuxin Guo, Qiushi Yang
Obstructive sleep apnea (OSA) is a well-known risk factor for hypertension. Moderate-to-severe OSA is more likely to lead to resistant hypertension (RH) compared to the absence of moderate-to-severe OSA. Early identification of patients with OSA among those with RH is crucial for prioritizing diagnosis and reducing the burden. However, currently, there is a lack of specific tools for assessing the risk of moderate-to-severe OSA in patients with RH. In this retrospective cohort study conducted from October 2023 to August 2024, 659 patients with RH from the health examination center of a tertiary hospital in Northeast China completed polysomnography. Based on the polysomnography results, the participants were divided into a group without moderate-to-severe OSA (control group) and a moderate-to-severe OSA group. The sample was randomly divided into a development cohort (461 patients) and a validation cohort (198 patients), and the incidence of OSA in the two groups was comparable (P > 0.05). Relevant clinical data of patients with RH were collected. The Least Absolute Shrinkage and Selection Operator method was used to identify independent risk factors. Subsequently, three predictive models were developed based on ten variables, including waist circumference, waist-to-hip ratio, low-density lipoprotein, morning dry mouth, serum creatinine, homocysteine, drinking, cholesterol, triglycerides and smoking. Among these models, the random forest model showed excellent discrimination and calibration in development and validation cohorts. Additionally, decision curve analysis was performed on the random forest model, as well as the STOP-Bang questionnaire and the Berlin questionnaire, to evaluate their clinical benefits. Finally, Shapley Additive Explanations analysis clearly indicated that waist circumference was the most important factor in predicting comorbid moderate-to-severe OSA in RH patients.
Nearly one-third of adults globally have hypertension, which constitutes a major public health burden^1^. Notably, 20–30% of hypertensive patients develop resistant hypertension (RH). RH patients represent a unique risk group, as they face a greater risk of severe damage to various organs compared to those with well-controlled hypertension. Thus, seeking secondary causes of hypertension in RH patients is crucial for blood pressure management^2^.
Obstructive sleep apnea (OSA), a prevalent sleep disorder, is characterized by reduced upper airway muscle tone during sleep, leading to intermittent hypoxia, autonomic dysfunction, and sleep fragmentation, accompanied by systemic inflammation, endothelial dysfunction, oxidative stress, and hypercoagulability^3^. This pathological process not only triggers sleep architecture disruption, snoring, and symptoms such as daytime fatigue and excessive sleepiness^2^, but also elevates cardiovascular risks—particularly hypertension—through chronic physiological stress^4^. Epidemiological evidence reveals that OSA prevalence ranges from 37% to 56% in patients with essential hypertension^5^, and escalating to 70%-83% in those with RH^6^.
As an independent risk factor, OSA can induce or exacerbate the occurrence of RH through multiple mechanisms^7^. Research found that individuals with moderate-to-severe OSA have nearly 2.5 times the risk of cardiovascular events compared to those without moderate-to-severe OSA^8^. A cross-sectional study analyzing 422 patients with RH found that the prevalence rates of mild OSA and moderate-to-severe OSA were 26.7% and 55.5%, respectively^9^. Among patients with moderate-to-severe OSA, the prevalence of non-dipping blood pressure patterns was even higher^10^.
RH management is currently sub-optimal, and OSA treatment shows promise as a therapeutic target, especially in moderate-to-severe OSA cases^8,11,12^. Guidelines recommend OSA screening in hypertensive, especially RH patients^13,14^. Polysomnography (PSG) is the gold-standard for OSA diagnosis^15^. But in China, it’s only available in tertiary hospitals, costly, resource-intensive, and thus not suitable for routine screening^16^. Many Chinese with moderate-to-severe OSA remain undiagnosed^17^. Sending patients without moderate-to-severe OSA to monitoring institutions further increases the pressure on available resources. Therefore, there’s a need for a tool to predict OSA risk in RH patients for targeted PSG.
In recent years, numerous studies have made progress in the risk screening of OSA, exploring predictive factors such as obesity and age, and proposing various models^18–20^. However, these studies didn’t focus on RH patients with moderate-to-severe OSA. It is known that anthropometric variables such as body mass index (BMI), neck circumference (NC), and waist circumference (WC), as well as clinical symptoms such as snoring, are key factors in OSA risk prediction. Nevertheless, currently, there is a lack of machine learning approaches based on measurement variables such as waist-to-hip ratio (WHR) and waist-to-height ratio (WHtR), clinical symptoms such as dry mouth upon waking up in the morning, and laboratory indicators including low-density lipoprotein (LDL) and homocysteine (HCY).
This study aimed to develop and validate a machine-learning model to predict comorbid moderate-to-severe OSA in RH patients. The Shapley Additive Explanations (SHAP) methodology was used for model interpretability, to understand OSA-related risk factors in these patients^21–23^.
This study utilized clinical records from patients with RH who underwent health examinations at the First Affiliated Hospital of Jinzhou Medical University between October 2023 to August 2024, to conduct a retrospective single-center study. All patients were diagnosed with RH, had their blood samples collected at the physical examination center from October 2023 to July 2024, and underwent PSG testing in the sleep monitoring unit from November 2023 to August 2024.
This study adhered to the revised Declaration of Helsinki 2015 and was approved by the Ethics Committee of Jinzhou Medical University (Approval No. JZMULL2025087).
The inclusion criteria were as (1) age ≥ 18 years; (2) meeting the clinical diagnostic criteria outlined in the Chinese Expert Consensus on Blood Pressure Management of RH^24^; and (3) Signed the informed consent form and cooperated in completing the study. The study excluded participants who met the following (1) patients with secondary hypertension; (2) patients with white coat hypertension; (3) patients with Pseudo-RH; (4) patients with controlled blood pressure; (5) patients with a history of snoring shorter than the duration of RH; (6) patients with a history of OSA; (7) patients with incomplete baseline data; and (8) female patients.
Decision tree (DT) and extreme gradient boosting (XGBoost) models do not have explicit sample size restrictions. According to the sample size estimation method of the random forest (RF) model^25^, the sample size should be at least 5 to 10 times the number of independent variables. This study plans to include 43 independent variables. Based on literature data, the incidence of severe OSA in patients with RH is 55.5%^26^. Considering a 10% dropout rate, the sample size is determined as in Formula (1):1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ N=43*5/55.5% /(1 - 10% )
Meaning the required sample size is at least 430 cases. This study ultimately included 659 study subjects, meeting the aforementioned requirements. ### Risk factors #### OSA assessment instrument Subjects included in this study underwent full-night PSG and were monitored for more than 7 h. The parameters recorded during PSG included airflow (nasal cannula and thermistor), respiratory movements (respiratory inductance plethysmography), pulse oxygen saturation, snoring events, electrocardiography, and body position. These data were first automatically analyzed by the ResMed system (ResMed AirSolutions™ Enterprise Software Suite, AirSolutions 2.0, [https://www.resmed.com/airsolutions](https://www.resmed.com/airsolutions)) software and then manually evaluated by certified polysomnographic technologists. The scoring of sleep stages and respiratory events was conducted and supervised according to the setup specifications recommended in the American Academy of Sleep Medicine (AASM) guidelines^27^. The AASM diagnosed OSA based on the apnea-hypopnea index (AHI), which was quantified as the total number of apneas or hypopneas recorded per hour of sleep. Therefore, in this study, subjects were divided into a group without moderate-to-severe OSA (control group, AHI < 15/h) and a moderate-to-severe OSA group (AHI ≥ 15/h) based on the AHI threshold^28^. ### Predictor variables We identified 43 potential predictor variables for our study, which were selected based on existing literature and clinical expertise. Basic information was collected from participants in a fasting state, including height, weight, NC, WC, and hip circumference (HC), with height and weight measured to the nearest 0.1 cm and 0.1 kg, respectively. BMI was calculated by dividing weight (kg) by height (m) squared. NC, WC, and HC were measured directly using a flexible measuring tape, with NC measured at the level of the cricoid cartilage, WC measured at the midpoint between the lower rib margin and the iliac crest, and hip circumference measured at the maximum extension of the buttocks. The WHR was calculated by dividing WC (cm) by hip circumference (cm), and the WHtR was calculated by dividing WC (cm) by height (cm). To ensure measurement quality control, all indicators were measured twice by the same evaluator, and the average values were taken. Blood pressure was measured after the patient rested quietly for at least 5 min, sitting upright with their back supported and feet flat on the floor. Sitting arm blood pressure was measured using an upper arm electronic sphygmomanometer (Omron HEM-RML31). After activating the device, systolic and diastolic pressures were recorded, and measurements were repeated after 1–2 min, with the average of three readings taken. RH is defined by the situation that, on the basis of lifestyle improvement, after being treated with three reasonably prescribed antihypertensive drugs at tolerable and sufficient dosages (including one thiazide diuretic) for at least four weeks, the blood pressure values measured in the clinic and outside the clinic still remain above the target levels or at least four drugs are required to achieve the target blood pressure^24^. All participants had previously undergone an ambulatory blood pressure monitoring test and had been diagnosed with RH by cardiologists. Fasting venous blood samples (with a fasting time of over 12 h) were collected in the morning, and biochemical indicators such as triglycerides (TG), high-density lipoprotein cholesterol (HDL), and LDL, along with blood parameters including white blood cells (WBC), platelets (PLT), and neutrophils (N), were measured using the ARCHITECT C^8000^ fully automated biochemical analyzer. ### Model building Based on the optimal development-to-validation cohort ratio (7:3) proposed by Poldrack^29^ we partitioned the total sample using the “caret” package (version 6.0–94) in R (R Foundation for Statistical Computing, version 4.4.0, Vienna, Austria, [https://www.r-project.org](https://www.r-project.org)). The total sample was randomly partitioned into development and validation cohorts using the caret package, with the random seed systematically fixed at 123 prior to division to ensure reproducibility of the allocation process. To eliminate the impact of multicollinearity, this study employed Least absolute shrinkage and selection operator (LASSO) logistic regression to identify risk factors. LASSO logistic regression compresses certain coefficients to zero by introducing an L1 penalty term in the loss function. In this process, independent variables with coefficients of zero were excluded from the model, while those with non-zero coefficients were retained. RF, DT, and XGBoost models were developed on the development cohort, with grid search used to optimize the parameters of each model. Ten-fold cross-validation was employed to evaluate the area under the receiver operating characteristic curve (AUC), positive predictive value (PPV), negative predictive value (NPV), Youden Index (YI), sensitivity, specificity, F1score, and accuracy of the three machine learning classifiers in the validation cohort. Additionally, decision curve analysis (DCA) was conducted to assess the clinical net benefit of the models. The net benefit was calculated using the Formula (2):2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ N{\text{et benifit = }}\frac{{TP - FP*\frac{{Pt}}{{1 - Pt}}}}{N} $$\end{document} where *TP* is the number of true positives, *FP* is the number of false positives, *N* is the total sample size, and *Pt* is the threshold probability^30^. A comprehensive comparison of multiple evaluation metrics was then performed to identify the optimal clinical prediction model. Finally, SHAP analysis was used to quantify the contribution of each variable to the predictions of the optimal model. ### Statistical analysis Data analysis was performed using IBM SPSS Statistics (Statistical Package for the Social Sciences, version 27.0.1, Chicago, USA, [https://www.ibm.com/products/spss-statistics](https://www.ibm.com/products/spss-statistics)). The following operations were performed in SPSS the Kolmogorov-Smirnov test was used to assess the normality of the data; categorical variables were expressed as counts (percentages) and compared between the development and validation cohorts using chi-square tests. Continuous variables that followed a normal distribution were presented as means (standard deviations) and assessed using t-tests. For variables that exhibited a skewed distribution, the median and interquartile range M (P25, P75) were used to represent the data, and the Mann-Whitney U test was employed for inter-group comparisons. ## Results ### Characteristics of study patients Among the 1337 patients who attended the medical examination center, a total of 659 patients met the inclusion criteria and were included in this study. The patient screening process is shown in Fig. 1. The baseline characteristics of patients in the development and validation cohorts and comparisons between the two cohorts are shown in Table 1. The incidence of moderate-to-severe OSA was comparable between the development cohort (59.5%) and the validation cohort (60.9%) (*P* = 0.412). There were no significant differences between the two groups in most characteristics. In the study, there was missing data for the following variables (percentage of missing values, based on the included sample size): NC (3.0%), BMI (4.9%), pulse (6.8%), cholesterol (1.6%), TG (2.2%), HCY (8.7%), aspartate aminotransferase (6.3%), alanine aminotransferase (6.3%), albumin (7.1%), globulin (6.5%), serum creatinine (7.8%), uric acid (7.2%), urea (7.5%), WBC (5.4%), lymphocytes (7.4%), N (6.6%), PLT (8.0%), mean platelets volume (8.9%), basophils (9.2%), eosinophils (8.1%), snoring (1.4%), morning dry mouth (3.2%), daytime sleepiness (1.1%), daytime tiredness (0.09%). During the model construction phase, we used the deletion method to remove samples containing missing values. Fig. 1Flowchart of patient selection. *OSA*, obstructive sleep apnea. Table 1Basic characteristics in the development and validation cohorts.VariablesDevelopment cohort (*n* = 461)Validation cohort (*n* = 198)95% CI*P* valuePhysiological measurement indicators Waist circumference (cm)89.10 ± 8.4490.23 ± 12.38− 3.026, 0.7660.242 Hip circumference (cm)100.04 ± 8.28101.51 ± 10.04− 3.066, 0.1260.071 Waist-to-hip ratio0.80 ± 0.180.83 ± 0.23− 0.066, 0.0060.097 Waist-to-height ratio0.59 ± 0.140.62 ± 0.20− 0.064, 0.0010.055 Neck circumference (cm)35.25 ± 3.8736.56 ± 14.79− 2.672, 0.0520.059 Body Mass Index (kg/m^2^)18.32 ± 3.7519.39 ± 5.22− 2.270,0.1300.008 Age (years)49(34, 64)50(37, 65)− 3.501, 1.5280.320 Gender Male293(63.56%)127(64.14%)− 0.086, 0.0740.890 Pulse (bpm)72 ± 1171 ± 12− 0.983, 2.9830.312Comorbidities Hypertension classification Stage 1 hypertension251(54.45%)110(55.56%)− 0.097, 0.0650.700 Stage 2 hypertension130(28.20%)56(28.28%)− 0.086, 0.0650.780 Stage 3 hypertension80(17.35%)33(16.67%)− 0.079, 0.0470.620 Diabetes mellitus, yes75(16.27%)25(12.63%)− 0.021, 0.0940.230Laboratory measurement indicators Cholesterol (mmol/L)6.43 ± 0.706.74 ± 0.92− 0.621, 0.0010.050 Triglycerides (mmol/L)2.14 ± 0.802.07 ± 0.34− 0.017, 0.1570.116 Low-density lipoprotein (mmol/L)2.93 ± 1.282.74 ± 1.07− 0.001, 0.3790.052 High-density lipoprotein (mmol/L)1.24 ± 1.311.09 ± 0.86− 0.002, 0.3020.056 Homocysteine (mmol/L)8.70(7.56, 10.02)8.75(7.45, 9.71)− 0.230, 0.1300.058 Aspartate aminotransferase (U/L)34.95(31.48, 38.18)35.10(31.70, 38.60)− 0.420, 0.3200.790 Alanine aminotransferase (U/L)34.47(31.78, 37.16)34.61(32.26, 36.69 )− 1.250, 1.050.870 AST/ALT2.67 ± 0.712.54 ± 0.584− 0.006, 0.2660.065 Total protein (g/L)74.39 ± 8.5175.85 ± 11.61− 0.326, 0.3400.112 Albumin/globulin ratio1.60 ± 0.621.62 ± 0.66− 0.128, 0.0880.717 Total bilirubin (µmol/L)5.64 ± 1.566.01 ± 1.67− 0.753, 0.0130.057 Serum creatinine (mmol/L)94.85 ± 3.0595.17 ± 5.00− 1.070, 0.4300.404 Uric acid (µmol/L)230.07(210.22, 249.92)230.51(215.02, 246.00)− 3.150, 2.1500.710 Urea (µmol/L)5.95 ± 3.055.83 ± 2.92− 0.370, 0.6100.633 White blood cells (×10^9^/L)4.33 ± 1.244.50 ± 1.14− 0.366, 0.0260.087 Monocytes (cells/µL)6.25 ± 0.816.41 ± 1.35− 0.363, 0.0430.122 Lymphocytes (×10^9^/L)1.63 ± 0.421.59 ± 0.39− 0.203, 0.2830.523 Neutrophils (×10^9^/L)4.07 ± 1.484.05 ± 1.52− 0.230, 0.2700.871 Platelet Count (×10^9^/L)137.95(126.31, 149.59)137.81(126.28, 149.34 )− 1.850, 2.0500.920 Mean platelet volume (%)13.51 ± 3.8414.37 ± 5.27− 1.800, 0.0800.074 Basophils (×10^9^/L)0.06 ± 0.160.07 ± 0.11− 0.031, 0.0110.355 Eosinophils (×10^9^/L)0.48 ± 0.160.51 ± 0.19− 0.060, 0.0000.059 (WBC + neutrophils) / lymphocytes5.77 ± 2.416.08 ± 2.67− 0.740,0.1200.160 NLR2.25 ± 0.952.39 ± 1.28− 0.340, 0.0600.168 AHI16.20 ± 15.2016.50 ± 14.60− 2.790, 2.1900.812Subjective feelings Total sleep time (h)7.30 ± 1.627.10 ± 2.05− 0.120, 0.5200.224 Snoring, yes283(61.39%)124(62.63%)− 0.093, 0.0680.764 Morning dry mouth Never82(17.79%)36(18.18%)− 0.068, 0.0600.905 One to two times per week88(19.09%)37(18.69%)− 0.061, 0.0690.904 Three to four times per week97(21.04%)41(20.71%)− 0.064, 0.0710.924 Five to six times per week115(25.00%)51(25.76%)− 0.075, 0.0600.826 Everyday79(17.14%)31(15.66%)− 0.005, 0.0080.630 Daytime fatigue, yes160(34.71%)70(35.35%)− 0.008, 0.0070.898 Daytime sleepiness, yes230(49.89%)99(50.00%)− 0.008, 0.0100.809 Smoking, yes245(53.15%)108(54.55%)− 0.014, 0.0250.713 Drinking, yes256(55.53%)112(56.57%)− 0.031, 0.0280.765*bpm*, beats per minute; *AST*, aspartate aminotransferase; *ALT*, Alanine aminotransferase; *NLR*, neutrophil–lymphocyte ratio; *AHI*, apnea-hypopnea index. ### Predictor variable screening using LASSO logistic regression We randomly assigned 70% of patients with RH (*n* = 461) to the development cohort and 30% (*n* = 198) to the validation cohort. The former was used for model building and training, while the latter was used to evaluate the model’s performance. To address the multicollinearity among the 43 variables derived from univariate analysis, we employed LASSO logistic regression for variable selection. The LASSO logistic regression error plot (Fig. 2) was obtained through cross-validation. To enhance the model’s generalization ability, we selected a value that is one standard error away from the minimum standard error corresponding to the ten variables, which include WC, WHR, LDL, HCY, CHOL, TG, SCR, morning dry mouth, smoking, and drinking, as indicated by the dashed line in Fig. 3. Fig. 2LASSO logistic coefficient profiles of the 43 variables. In LASSO regression, as the penalty parameter λ increases, the coefficients of each predictive variable are gradually shrunk, ultimately leading to some less important variables having their coefficients compressed to zero. Fig. 3Cross-validation results. The value between the two dashed lines is the range of positive and negative standard deviations of log(λ). Finally, ten variables were selected when log(λ) = 0.026. ### Construction of the prediction model We used R software to integrate the aforementioned 10 independent predictors and established three prediction models for the risk of moderate-to-severe OSA using DT, RF, and XGBoost, respectively. ### Decision tree model This study constructed an optimal DT model (Fig. 4) through pre-pruning and post-pruning, with cp. values set at 0.001 and 0.005, respectively. RH combined with moderate-to-severe OSA is related to six predictive morning dry mouth, HCY, WC, drinking, WHR, and smoking. Using morning dry mouth as the root node, there are seven pathways to predict the comorbidity of moderate-to-severe OSA in RH patients. Conversely, Among the RH patients using morning dry mouth as the root-node in the DT model, if a patient experiences morning dry mouth, the probability of having moderate-to-severe OSA is as high as 96.6%. Fig. 4Decision tree path diagram. *Nor*, normal ; *Dis*, disease; *HCY*, homocysteine; *WHR*, waist-to-hip ratio; *WC*, waist circumference. ### Random forest This study included a total of 10 predictive factors, with mtry set to based on calculations. By adjusting and optimizing the parameters, the OOB error curve leveled off when ntree = 100 (Fig. 5). After model construction, the importance of the 10 predictive factors was ranked based on the Mean Decrease Gini (Fig. 6). The top five important variables were WC, WHR, CHOL, SCR, and HCY, in that order. Fig. 5Observational bias of the random forest. Fig. 6Importance ranking of predictive factors in the random forest. *WC*, Waist circumference; *WHR*, Waist-to-Hip Ratio; *CHOL*, cholesterol; *SCR*, serum creatinine; *HCY*, Homocysteine; *LDL*, low-density lipoprotein; *TG*, Triglycerides; *MDM_ED*, Morning dry mouth_everyday. ### Extreme gradient boosting To enhance the stability of the model, this study set the learning rate to 0.02. Additionally, the maximum depth of the trees was limited to 4, and 80% of the features were randomly selected for each tree to prevent overfitting and improve the diversity of the model. ### Evaluation of the prediction model Table 2 summarizes the performance of each model, with the corresponding receiver operating characteristic (ROC) curves presented in figs. 7, 8 and 9. The models’ AUCs ranged from 0.824 to 0.922. The RF model demonstrated the best performance, achieving an AUC of 0.922 (95% CI 0.901–0.942), sensitivity of 0.881 (95% CI 0.866–0.894), specificity of 0.873 (95% CI 0.857–0.887), F1 score of 0.884 (95% CI 0.869–0.896), accuracy of 0.862 (95% CI 0.857–0.865), PPV of 0.901 (95% CI 0.878–0.922), NPV of 0.893 (95% CI, 0.869–0.914), and YI of 0.754 (0.733–0.775). Further, delong’s test indicated that the RF model exhibited significantly superior discriminative performance compared to both the DT and XGBoost models (*p* < 0.001, Table 3). Internal validation using the bootstrap method with 1,000 resampling iterations was performed, and the models’ predictive performance was assessed using the C-index (Figs. 10, 11, and 12). Finally, DCA revealed that the RF model provided a better net benefit than both the STOP-Bang questionnaire (SBQ) and Berlin questionnaire across a threshold probability range of 24–80% (Fig. 13). Table 2 Model performance in predicting delirium in the development and validation cohorts.ModelAUC(%)Sensitivity(%)Specificity(%)F1 scoreAccuracy(%)PPVNPVYIDevelopment cohort DT0.870 (0.852, 0.888)0.907 (0.885, 0.926)0.825 (0.797, 0.851)0.849 (0.823, 0.873)0.841 (0.814, 0.866)0.863 (0.838, 0.886)0.834 (0.807, 0.859)0.732 (0.698, 0.766) RF0.991 (0.982, 1.000)0.916 (0.905, 0.924)0.922 (0.911, 0.930)0.904 (0.892, 0.913)0.902 (0.880, 0.922)0.892 (0.874, 0.907)0.917 (0.901, 0.930)0.820 (0.806, 0.834) XGBoost0.862 ( 0.833, 0.891)0.891 (0.867, 0.912)0.786 (0.757, 0.814)0.861 (0.836, 0.884)0.895 (0.872, 0.915)0.851 (0.825,0.875)0.806 (0.778, 0.832)0.677 (0.641, 0.713)Validation cohort DT0.855 (0.827, 0.882)0.863 (0.838, 0.886)0.852 (0.826, 0.876)0.862 (0.837, 0.885)0.835 (0.807, 0.861)0.886 (0.862, 0.908)0.815 (0.785, 0.844)0.715 (0.680, 0.750) RF0.922 (0.901, 0.942)0.881 (0.866, 0.894)0.873 (0.857, 0.887)0.884 (0.869, 0.896)0.862 (0.857, 0.865)0.901 (0.878, 0.922)0. 893 (0.869, 0.914)0.754 (0.733, 0.775) XGBoost0.824 (0.816, 0.832)0.837 (0.809, 0.864)0.842 (0.814, 0.868)0.826 (0.797, 0.853)0.839 (0.821, 0.855)0.894 (0.870, 0.916)0.872 (0.846, 0.896)0.715 (0.684,0.746)*AUC*, the area under the receiver operating characteristic curve; *PPV*, positive predictive value; *NPV*, negative predictive value; *RF*, random forest; *YI*, Youden Index; *DT*, decision tree; XGBoost, extreme gradient boosting. Fig. 7The ROC curves of decision tree in the development and validation cohorts. Fig. 8The ROC curves of random forest in the development and validation cohorts. Fig. 9The ROC curves of extreme gradient boosting in the development and validation cohorts. Table 3DeLong’s test.AUC differenceOR95% CIZ-value*P* valueRF vs. DT0.0670.032, 0.1024.21<0.001RF vs. XGBoost0.0980.085, 0.1117.92<0.001DT vs. XGBoost0.0310.004, 0.0582.310.021*RF*, random forest; *DT*, decision tree; *XGBoost*, extreme gradient boosting. Fig. 10Calibration curve of the decision tree in the validation cohort. Fig. 11Calibration curve of the random forest in the validation cohort. Fig. 12Calibration curve of the extreme gradient boosting in the validation cohort. Fig. 13The DCA of the optimal model compared to the SBQ questionnaire and Berlin questionnaires. *RF*, random forest; *SBQ*, STOP-Bang questionnaire. ### Explanation of random forest model with the SHAP The SHAP algorithm was utilized to assess the importance of each predictor factor in the RF model’s predictions. The predictor importance plot (Fig. 14) lists the relative importance of the various predictors in descending order. WC indicated the strongest predictive ability for the outcome, followed by WHR, LDL, morning dry mouth_everyday, and SCR. To evaluate the positive and negative relationships between predictor factors and predicted outcomes, this study employed SHAP value analysis to identify the associated risk factors for moderate-to-severe OSA in patients with RH. As shown in Fig. 15, the results indicate that an increase in WC is positively correlated with the occurrence of moderate-to-severe OSA. Fig. 14SHAP bar chart of the first 10 influence variables of the random forest model. *WC*, waist circumference; *WHR*, waist-to-hip ratio; *LDL*, low-density lipoprotein; *MDM_ED*, morning dry mouth_everyday; *SCR*, serum creatinine; *HCY*, homocysteine; *CHOL*, cholesterol; *TG*, triglycerides. Fig. 15The SHAP values. *WC*, waist circumference; *WHR*, waist-to-hip ratio; *LDL*, low-density lipoprotein; *MDM_ED*, morning dry mouth_everyday; *SCR*, serum creatinine; *HCY*, homocysteine; *CHOL*, cholesterol; *TG*, Triglycerides. ## Discussion In recent years, random forest models have been widely applied in the field of OSA for predictive purposes^31,32^. This model exhibits greater sensitivity to relevant features and possesses strong nonlinear modeling capabilities. By utilizing random feature selection through DT, RF can effectively balance sampling errors, thereby reducing the risk of overfitting and enhancing the model’s generalization ability. In this study, certain clinical features were derived from height and hip circumference, and multicollinearity tests indicated collinearity among the variables (VIF > 10). Therefore, LASSO logistic regression was employed to select the indicators by introducing an L1 penalty term into the loss function, which compresses some coefficients to zero. In this process, independent variables with coefficients of zero were excluded from the model, while those with non-zero coefficients were retained^33^. Additionally, the random forest model indicated good predictive accuracy and clinical utility. Ultimately, this study utilized SHAP analysis to select five clinical features and five laboratory WC, WHR, morning dry mouth, drinking, smoking, LDL, SCR, HCY, CHOL, and TG. The SHAP analysis results indicate that WC has the highest SHAP value, making it the primary factor for screening moderate-to-severe OSA in RH patients and significantly impacting model predictions. Patients with RH often exhibit lower testosterone levels, leading to central obesity. Accumulation of abdominal fat not only serves as a trigger for systemic chronic inflammation, but also directly reduces lung capacity^34^ resulting in upper airway collapse and increased risk of sleep apnea^16^. WC is considered a surrogate indicator of abdominal obesity^35^. Studies have shown a linear inverse relationship between sleep duration and WC. Since OSA is characterized by partial or complete upper airway obstruction during sleep, it leads to sleep fragmentation and reduced sleep duration. This implies that OSA patients tend to have larger WC^36^. Furthermore, WHR is regarded as the most reliable and sensitive indicator of obesity; individuals with a WHR ≥ 0.95 have double the risk of moderate-to-severe OSA compared to the patients without moderate-to-severe OSA^37^. Our findings emphasize the importance of considering patients’ medical history when assessing moderate-to-severe OSA. Morning dry mouth is an independent risk factor for moderate-to-severe OSA^38^. Studies indicate that the incidence of morning dry mouth among OSA patients is twice that of simple snorers^39^. As OSA severity increases, patients experience a significant reduction in salivary volume, a decrease in salivary flow rate, and an increase in salivary acidity^40^. Therefore, the symptom of dry mouth should be considered an important indicator for the screening and diagnosis of OSA. A substantial body of research has indicated a strong correlation between smoking and the severity of OSA^39–45^. Smoking may lead to the symptoms of OSA by aggravating chronic airway inflammation, and promoting snoring and apnea. In addition, active smokers have poor sleep quality, and they have difficulties in falling asleep and maintaining sleep. Studies have found that patients with severe OSA have higher levels of nicotine dependence and that the duration of smoking is significantly associated with the severity of OSA. Bielicki’s study of 3,613 OSA patients reported that smokers had a higher AHI and lower minimum oxygen saturation^46^.Recent research by Yosunkaya further confirmed that severe OSA patients often exhibit smoking behavior, and there is a positive correlation between AHI and smoking quantity^47^. The adverse effects of alcohol on OSA involve a selective reduction in the conduction of the genioglossus and hypoglossal nerves, leading to increased upper airway resistance, airway collapse, reduced arousal response, and decreased hemoglobin affinity for oxygen^48^. Furthermore, excessive alcohol consumption may lead to weight gain, which is closely associated with unstable ventilation control and upper airway obstruction due to neck fat deposition^49^. Research indicates that blood parameters are also important predictive indicators. Patients with OSA exhibit lipid metabolism disorders characterized by high cholesterol and high triglycerides. A meta-regression analysis involving 18,116 subjects found that the degree of dyslipidemia correlates with the severity of OSA, with OSA patients showing elevated total cholesterol, triglycerides, and LDL levels^50^. This may be related to factors such as intermittent hypoxia, oxidative stress, and inflammation. Furthermore, the association between OSA and renal impairment, as well as end-stage renal disease (ESRD), was first reported in 1985^51^. Studies show that the prevalence of OSA in ESRD patients can reach as high as 57%^52^, which is linked to the damage caused by nocturnal intermittent hypoxia to renal function^53^. A large prospective cohort study of over 30,000 U.S. veterans found that the incidence of chronic kidney disease in OSA patients is approximately three times higher than that in the control group, with a greater risk of rapid renal function deterioration^54^. Therefore, serum creatinine serves as a crucial predictor and management indicator for severe OSA in patients with RH, playing a vital role in preventing and mitigating the progression of renal disease in this population. Finally, prior meta-analyses have indicated that OSA is associated with elevated serum HCY levels, and continuous CPAP therapy can reduce blood HCY levels^55^. OSA may lead to intermittent hypoxia and frequent awakenings, which trigger inflammatory responses that increase reactive oxygen species (ROS) levels. Additionally, localized inflammatory responses due to repeated upper airway collapse may lead to systemic inflammation. Homocysteine, with its highly reactive thiol group, is prone to self-oxidation, resulting in over 98% of HCY being in an oxidized state. This predisposes the vascular endothelium to direct injury from activated ROS and leukocytes. As oxidative stress products increase, the oxidative stress capacity within individuals with OSA gradually declines^56^ with HCY playing a key role in the development of oxidative stress associated with OSA. This study has significant advantages. Based on the routine examination data from health check-up centers, a prediction model for the risk of moderate-to-severe OSA in patients with RH was constructed. This model integrates multiple independent risk factors, covering dimensions such as physiological measurements, comorbidities, laboratory tests, and subjective feelings, ensuring the practicality and operability of clinical applications. The application of SHAP analysis enhances the interpretability of the model. It clarifies the contributions of various risk factors to the prediction results, improves the credibility of the model, provides strong support for clinical decision-making, and helps doctors conduct precise assessments and management based on the individual conditions of patients. This method stratifies OSA patients according to the prediction results of the model. It prioritizes the confirmatory testing of high-risk patients, effectively improving the diagnostic efficiency, reducing unnecessary examinations, lowering the medical costs of patients, avoiding the waste of medical resources, optimizing the allocation of medical resources, and providing a scientific and efficient basis for clinical diagnosis and treatment decisions. This study has some significant limitations. Firstly, the data used to construct and validate the model were all sourced from the same hospital, and such single-source data may be subject to bias. Second, due to the limited sample size, this study only conducted internal validation and did not establish a validation group to validate the predictive model. Finally, the model was specifically developed for Chinese RH patients, which may limit its applicability to other ethnic groups. Future studies should utilize large, multicenter samples to conduct external validation of the model. This will help further validate the model’s performance and generalizability across different environments, ensuring its reliability in various clinical settings. ## Conclusion This study developed a predictive model comprising ten WC, WHR, LDL, morning dry mouth, SCR, HCY, drinking, CHOL, TG and smoking. This model indicated strong predictive capability for moderate-to-severe OSA in patients with RH. Therefore, it serves as a valuable tool for clinicians in assessing the moderate-to-severe OSA of patients with RH, aiding in clinical decision-making. Compared to PSG, the clinical parameters in this model are easier to access and evaluate. Additionally, SHAP analysis further enhances the model’s interpretability, and this transparency increases the model’s credibility. The model can be integrated into clinical practice to assist caregivers in early prediction of moderate-to-severe OSA likelihood in patients with RH, thereby prioritizing preventive and therapeutic measures that may help delay or even reverse the adverse cardiovascular complications associated with OSA. However, further research and validation of the model are necessary before considering its practical clinical applications to ensure the stability of its predictive performance.