Study enrollment analysis process
The flowchart for the enrollment of this study is shown in Fig. 1. In total, 400 patients underwent lung surgery from November 2019 to June 2021, but 52 were unsuitable for this study due to severe electrolyte imbalance (n = 3), severe acid–base imbalance (n = 3), severe heart failure (n = 1), and intraoperative blood gas analysis not being performed (n = 45). The remaining 348 patients were included in the experimental study, among whom 96 had hypercapnia and 252 had non-hypercapnia.
Table analysis of clinical baseline characteristics
Between the two patient groups, the differences in the following variables were statistically significant: age (p = 0.001), weight (p = 0.01), gender (p = 0.001), one lung ventilation time (min) (p = 0.409), and pulmonary function (p = 0.047) (Table 1).
Comprehensive variable screening and construction of logistic regression models
Random forest and preliminary variable screening were applied first. The results are shown in Fig. 2. A larger value of MeanDecreaseAccuracy or MeanDecreaseGini reflects the higher importance of the variable. MeanDecreaseAccuracy indicated that gender, age, one-lung ventilation position, minute ventilation, one-lung ventilation time, weight, and pulmonary function had progressively decreasing importance. MeanDecreaseGini indicated that age, weight, one-lung ventilation time, minute ventilation, gender, one-lung ventilation position, and pulmonary function had progressively decreasing importance.
Through further analysis of variable selection using logistic regression analysis and stepwise (stepAIC) selection, the best variables selected by stepwise (stepAIC) selection were gender, age, and one-lung ventilation position. The first three quantities of MeanDecreaseAccuracy in random forest variable selection were consistent. The logistic regression model constructed with gender, age, and one-lung ventilation position had an AIC of 363. The logistic regression model constructed with age, weight, and one-lung ventilation time had an AIC of 393. The smaller the AIC value, the closer the estimated probability distribution is to the true distribution, the more stable the model is, and the better the prediction effect is. Therefore, the logistic regression model constructed with gender, age, and one-lung ventilation position was the most stable model and had the best prediction effect.
Table 2 shows the OR values, 95% confidence intervals (CIs), and p-values for each variable in the logistic regression model, where p < 0.05 is statistically significant. Figure 3(A) shows the visualization of the forest plot for each variable. The following variables were independently predicted in the hypercapnia risk model:
-
age (p = 0.002, OR = 1.047, 95% CI [1.016, 1.078]);
-
Gender = 1 (p < 0.001, OR = 5.693, 95% CI [2.844, 11.394]);
-
one-lung ventilation position = 1 (p = 0.019, OR = 1.888, 95% CI [1.111, 3.209]).
Hence, we constructed logistic regression models for these three variables. The OR values, 95% CIs, and p-values of the screening variables in the final logistic, also shown in Table 3, were as follows:
-
age (p = 0.001, OR = 1.048, 95% CI [1.02, 1.078]);
-
gender = 1 (p < 0.001, OR = 6.051, 95% CI [3.209, 11.41]);
-
one-lung ventilation position = 1 (p = 0.019, OR = 1.868, 95% CI [1.106, 3.154]).
Figure 3(B) shows the visualization of the forest plot for the screening variables.
Combined with Table 4, the result of the Hosmer–Lemeshaw test of significance was > 0.05, indicating a stable and well-fitting model.
The final established model is as follows:−5.421 + 0.047age + 1.8×gender (= 1) + 0.625×one-lung ventilation position (= 1).
Construction of nomogram
The nomogram was constructed based on the final established logistic regression model. As shown in Fig. 4, the nomogram contains all independent factors that can significantly affect hypercapnia from the logistic regression model. A valid intuitive scoring scale was established based on the dominance ratio (OR) values of the risk factors. By summing the scores associated with each variable, the probability of hypercapnia can be predicted.
Results of the ROC curve and calibration curve
As shown in Table 5 and Fig. 5, the prediction of our constructed nomogram was 0.7457 (95% CI [0.6916, 0.7998]), which was higher than the prediction of any single factor in the nomogram (i.e., age, gender, and one-lung ventilation position), reflecting the good prediction of our nomogram. Furthermore, as shown in Fig. 6, calibration curves indicated good agreement between the nomogram and the actual situation.
Internal validation
Bootstrap was used as the internal validation method. The number of iterations was 1000, the average AUC was 0.745, and the average C-index was 0.742, showing that the model has good internal validation results with good predictability and stability.
Clinical decision curve results
DCA was conducted for the nomogram including age, gender, and one-lung ventilation position, and the results, shown in Fig. 7, indicate that the nomogram has some clinical benefit.