| Objectives(1)To identify risk factors associated with type Ⅱ respiratory failure in patients with AECOPD using a retrospective study.(2)To construct a Nomogram prediction model and a random forest prediction model for type Ⅱ respiratory failure in AECOPD patients and develop an online interactive dynamic line graph webpage to help medical professionals and patients provide quantitative risk values for future risk of type Ⅱ respiratory failure based on current health status.(3)Internal and external validation of the constructed Nomogram prediction model and random forest prediction model for AECOPD patients with concurrent type Ⅱrespiratory failure was performed to test the performance of the risk prediction model in terms of differentiation ability,calibration,clinical validity,and external scalability.Methods1.Construction of Nomogram prediction model and random forest prediction model for AECOPD complicated by type Ⅱ respiratory failureThe 1108 AECOPD inpatients admitted to a Classiii Grade A hospital in Yangzhou from January 2017 to December 2021 were used as the study subjects,and the case information of the study subjects,including demographic characteristics,clinical laboratory test indexes,comorbidities and clinical treatment information,was extracted through the hospital electronic medical record system.The data were entered using Epidata 3.1,and single-factor binary logistic regression analysis was performed using the R4.2.2 software glm function,and the variables with P<0.05 in the single-factor analysis were used as independent variables for multi-factor logistic regression analysis before regression to detect the presence of multicollinearity problems in each variable of the model.The Nomogram model was constructed using the "rms" package in R4.2.2 software.The random forest prediction model was constructed by applying the classifier RandomForestClassifie from the Scikit-learn open source toolkit in Python language,and the ROC curves were plotted with the help of the "pROC" package in R4.2.2 software in order to reflect the predictiveness of the line graph model.The Hosmer-Lemeshow goodness-of-fit test and calibration curve were used to evaluate the fit and calibration of the constructed model,respectively.The clinical utility of the constructed model was evaluated by plotting clinical decision curve analysis(DCA).Matplotlib in Python was used to visualize the output of the confusion matrix,and the metrics method of the sklearn module was used to calculate the accuracy,recall,precision,and F1 values.For ease of use,an online interactive dynamic column line graph web prediction calculator was developed using the shiny framework in R language.2.Internal validation of Nomogram prediction model and random forest prediction model for AECOPD complicated by type Ⅱ respiratory failureA computerized random number generator was used to randomly group 1108 AECOPD inpatients admitted to the Subei People’s Hospital from January 2017 to December 2021 into a modeling cohort and an internal validation cohort in a 7:3 ratio.The internal validation was performed using R4.2.2 statistical software,and Python 3.11 software to validate the risk prediction model in terms of its discriminatory ability,calibration,and clinical validity performance.3.External validation of Nomogram prediction model and random forest prediction model for AECOPD complicated by type Ⅱ respiratory failurePatients admitted with AECOPD at another Class ⅲ Grade A hospital in Yangzhou from January 2020 to December 2021 were used as the study subjects,and the case data of the study subjects were extracted through the hospital electronic medical record system to test the external validation of the prediction model for external adaptation.The external validation was performed using R4.2.2 statistical software and Python 3.11 software to validate the risk prediction model in terms of its performance in terms of differentiation ability,calibration,clinical validity,and external scalability.Results1.A total of 1108 patients with AECOPD were included in the study,with 340 cases of concomitant type Ⅱ respiratory failure and an incidence of 30.1%.A comparative analysis of the data between the modeling group and the internal validation group showed that the differences in general information between the two groups were not statistically different(P>0.05),suggesting good randomization of the data between the modeling and internal validation groups.All factors were analyzed univariately one by one,and the results showed that age,days of hospitalization,number of previous acute exacerbations,duration of COPD,GOLD pulmonary function class,presence of combined pulmonary hypertension,hypokalemia,anemia,arrhythmia,coronary artery disease,pulmonary artery disease,RBC,Hb,PH,PO2,PCO2,FEV1,FEV1/FVC,NLR,ALB,NT-ProBNP,CRP,and cTn I were statistically significant(P<0.05)between the two groups and were potentially associated with concurrent type Ⅱrespiratory failure outcomes.Multifactorial logistic regression analysis showed that PH(OR=0.194,95%CI:0.07-0.536),PO2(OR=0.969,95%CI:0.951-0.988),PCO2(OR=1.122,95%CI:1.067-1.18),FEV1/FVC(OR=0.577,95%CI:0.505-0.659),NT-proBNP(OR=1.392,95%CI:1.03-1.882),CRP((OR=1.009,95%CI:1.0-1.018),cTn I(OR=1.015,95%CI:1.008-1.023),ALB(OR=0.884,95%CI:0.789-0.99)were independent predictors of concomitant type Ⅱ respiratory failure in patients with AECOPD.the Nomogram prediction model had an AUC of 0.980(95%CI:0.972,0.988)in the modeled cohort,suggesting high model discriminatory power.The Hosmer-Lemeshow test was performed on the model,and the results showed P>0.05,suggesting a good model fit.The accuracy of model judgment was 94.2%,recall was 94.2%,precision was 94.2%,and F1 metric was 94.2%.Plotting the visual calibration curves of the models showed that the models all had good calibration ability,and plotting the decision curves of the prediction models showed that the models all produced better clinical benefits when the threshold probabilities were in the range of 0.01 to 0.96.The random forest prediction models were constructed and the results showed that the modules were ranked in order of importance from largest to smallest:FEV1/FVC,PCO2,cTn I,CRP,PO2,ALB,PH,NT-proBNP.based on the confusion matrix heat map,the models were shown to be able to make accurate predictions for the modeled cohort samples.2.Internal validation of the Nomogram prediction model with AUC=0.969(95%CI:0.953,0.985)maintained a high level of discriminatory power.The calibration curve of the model overlaps well with the diagonal,indicating that the model has high predictive calibration and good internal reproducibility and can pass internal validation.the DCA is similar to the modeling,still all far from extreme values,and the model produces better clinical benefit when the threshold probability is between 0.04 and 0.93.Internal validation of the random forest prediction model with AUC=0.974(95%CI:0.96,0.987)indicated that the model maintained a high level of discriminatory ability after the introduction of internal validation data.According to the confusion matrix heat map,the model can make more accurate predictions for the internal cohort samples.the RF model has higher accuracy,recall,precision,and FI metrics in the internal validation set and cross-validation set,suggesting that the algorithm model has higher accuracy and better prediction performance.3.150 clinical data of inpatients with AECOPD were included.Comparative analysis of the data between the modeling group and the external validation group showed no statistical difference in general information between the two groups(P>0.05),suggesting good randomization of the data in the modeling and external validation groups.External validation of the Nomogram prediction model with AUC=0.924(95%CI:0.882,0.967)maintained a high level of discriminatory power.The calibration curve of the prediction model overlaps with the diagonal line,indicating that the model has high prediction calibration and good extern al reproducibility and can pass external validation.the DCA is similar to the modeling,still all far from the extreme values,and the models all produce better clinical benefit when the threshold probability is in the range of 0.18~0.99.Internal validation of the random forest prediction model with AUC=0.974(95%CI:0.96,0.987)indicated that the model maintained a high level of discriminatory ability after the introduction of internal validation data.According to the confusion matrix heat map,the model can make more accurate predictions for the internal cohort samples.the RF model has higher accuracy,recall,precision,and F1 metrics in the external validation set and cross-validation set,suggesting that the algorithm model has higher accuracy and better prediction performance.Conclusion1.In a retrospective study of AECOPD patients,the analysis concluded that PH,PO2,PCO2,FEV1/FVC,NT-proBNP,CRP,cTn I,and ALB were independent predictors of AECOPD patients with concomitant type Ⅱ respiratory failure.The risk prediction model was constructed based on the above results,which showed that the model was effective in prediction and high accuracy,and eventually the prediction model was visualized and operationalized,which can be used to guide clinical work-up decisions to reduce patient mortality and improve outcomes.2.Internal and external validation of Nomogram prediction model and random forest prediction model for AECOPD complicated by type Ⅱ respiratory failure was performed,showing high accuracy of the prediction model and good prediction performance,confirming that the prediction model has good internal reproducibility and universal application value i.e.external scalability. |