Abstract
OBJECTIVE: Extended length of stay (eLOS) after hip fracture surgery in elderly patients poses significant clinical and economic challenges. While traditional statistical models identify key predictors, they may miss complex variable interactions. This study compared logistic regression with machine learning (ML) algorithms to predict eLOS, emphasizing actionable factors within Enhanced Recovery After Surgery (ERAS) protocols. METHODS: This retrospective cohort study analyzed 1137 patients aged ≥50 years who underwent hip arthroplasty or internal fixation for hip fracture (2019-2025). Extended LOS was defined as hospital stay ≥14 days based on median LOS of 13.8 days. Two prediction models were developed: preoperative (admission data only) and early in-hospital (including day-1 postoperative data). Multivariate logistic regression identified independent predictors, while nine ML algorithms were trained and validated using 10-fold cross-validation. Feature importance was assessed through SHAP analysis. RESULTS: Among 1137 patients, 500 (44.0%) experienced eLOS. Logistic regression identified male gender (odds ratio (OR) = 1.42, p = 0.01), delayed surgery >48 hours (OR = 2.31, p < 0.001), prolonged operation time (OR = 1.67, p = 0.02), and postoperative pneumonia (OR = 3.12, p < 0.001) as independent risk factors. Tranexamic acid (TXA) use was protective (OR = 0.65, p = 0.03). After 10-fold cross-validation, logistic regression and Support Vector Machine achieved area under the curve (AUC) = 0.76 (95% confidence interval (CI) 0.73-0.79), while XGBoost showed AUC = 0.72 (95% CI 0.69-0.75). SHAP (SHapley Additive exPlanations) analysis confirmed time-to-surgery, TXA use, and coagulation markers as key predictors across models. CONCLUSION: Both statistical and ML approaches identified delayed surgery and pneumonia as critical eLOS predictors, while ML revealed complex interactions involving coagulation dynamics and reinforced TXA's protective role. These findings support ML-augmented ERAS protocols targeting modifiable risk factors. External validation and clinical implementation studies are needed to confirm utility in routine practice.