# Predicting the risk of postoperative constipation in middle-aged and elderly patients with lower limb fractures using machine learning algorithms

**Authors:** Xiaoyan Yang, Wenqiang Li, Qin Xiao, Shiyun Du, Xi Wang, Ying Zhang, Sulian Li

PMC · DOI: 10.1371/journal.pone.0336466 · PLOS One · 2025-11-21

## TL;DR

This study uses machine learning to predict postoperative constipation risk in older patients with lower limb fractures, aiming to improve clinical prevention and early intervention.

## Contribution

A novel machine learning-based predictive model for postoperative constipation in elderly lower limb fracture patients is developed and validated.

## Key findings

- The logistic regression model showed the best predictive performance for postoperative constipation risk.
- Age, femoral fracture, hospital stay length, nutritional risk, and chronic gastritis were identified as key risk factors.
- The model can be integrated into clinical systems to flag high-risk patients and guide personalized interventions.

## Abstract

To construct and validate a predictive model for the risk of postoperative constipation in middle-aged and elderly patients with lower limb fractures based on machine learning algorithms, so as to provide decision-making support for clinical prevention and early intervention.

This study conducted a retrospective analysis of clinical data of 1,128 middle-aged and elderly patients who underwent lower limb fracture surgery between January 2020 and May 2024, with data collection occurring from October to December 2024. Whether constipation occurred or not was used as the outcome variable. Eight machine learning algorithms, namely logistic regression (LR), extreme gradient boosting (XGBoost), random forest (RF), decision tree classifier (DT), complement naive bayes (CNB), multilayer perceptron (MLP), support vector machine (SVM), and K-Nearest neighbors (KNN), were employed to construct predictive models. Key risk factors were identified using SHAP (SHapley Additive exPlanations), a game theory-based approach for analyzing feature importance. Model predictive performance was comprehensively evaluated using metrics including the area under the receiver operating characteristic curve (AUC), accuracy, and other relevant indicators.

The logistic regression (LR) model demonstrated the optimal predictive performance. Age, femoral fracture, length of hospital stay, nutritional risk, and chronic gastritis were identified as important predictive factors. This model can be integrated into the clinical information system to automatically flag high-risk patients upon admission and provide individualized interventions based on risk stratification.

The logistic regression (LR) model developed in this study exhibits strong discriminative ability and clinical utility, enabling dynamic perioperative monitoring of constipation risk through digital health tools, thereby potentially reducing related complications.

## Linked entities

- **Diseases:** constipation (MONDO:0002203), chronic gastritis (MONDO:0005001)

## Full-text entities

- **Diseases:** chronic gastritis (MESH:D005756), constipation (MESH:D003248), femoral fracture (MESH:D005264), fracture (MESH:D050723)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12637909/full.md

## Figures

4 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12637909/full.md

## References

48 references — full list in the complete paper: https://tomesphere.com/paper/PMC12637909/full.md

---
Source: https://tomesphere.com/paper/PMC12637909