November 16, 2026
Risk factors for unfavorable outcomes in patients admitted for rehabilitation in a transitional hospital
João Gabriel Rosa Ramos; Henrique Raymundo Gioia
DOI: 10.22167/2675-6528-202604288
Article derived from a Final Course Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
The risk factors for unfavorable outcomes, such as hospital readmission and unexpected death, in patients admitted for rehabilitation in a transition hospital were investigated. The objective was to create and analyze the performance of predictive models for these adverse outcomes, based on variables collected at admission. A retrospective cohort study was conducted with 1,306 individuals admitted between 2017 and 2024. Four statistical and machine learning models were compared: Logistic Regression, Decision Tree, Random Forest, and XGBoost, employing rigorous preprocessing, hyperparameter optimization via gridsearch, and k-fold cross-validation. The SHAP technique was used to identify the most impactful predictive variables. The unfavorable outcome was frequent, reaching 29% of the sample, predominantly due to hospital transfers (26%). The XGBoost algorithm demonstrated the best discriminative performance (AUC 0.723), being statistically superior to the Decision Tree and Random Forest. Functional status at admission (MIF scale), pressure injuries, and ICU origin were identified as the variables with the greatest predictive impact. It was concluded that gradient boosting models allow for effective risk stratification in post-acute settings, offering robust support for clinical decision-making and can be useful in predicting unfavorable outcomes, aiding in the mitigation of these risks.
Keywords: Post-Acute Care; Risk Stratification; Machine Learning; Predictive Models; Prognosis.
1. Introduction
Transitional hospitals play a crucial role in the healthcare system, acting as an intermediate step between the acute general hospital and home, as highlighted by Makam and Grabowski (2021). These institutions specialize in providing medical care to complex but clinically stable patients who require intensive rehabilitation, high-acuity nursing care, and, in some cases, end-of-life palliative care (Kahn et al., 2010; Lee et al., 2020; Ramos et al., 2024). They are characterized by short-term stays, distinguishing them from long-term care facilities.
Patients admitted to these hospitals frequently present a high degree of functional dependence and a high complexity of care. Generally, they are elderly individuals with multiple comorbidities, who have undergone prolonged hospitalizations due to serious conditions, such as cerebrovascular accidents, sepsis, post-operative complications, or trauma.
Despite clinical stability, the severity and complexity of these patients often necessitate transfer to general acute care hospitals during their stay in the transition hospital, an event known as readmission. Literature indicates that the readmission rate can reach 23% in the general population of post-acute patients, and be even higher in specific subgroups, such as cancer patients (Burke et al., 2016; Fu et al., 2014; Horney et al., 2017; Ottenbacher et al., 2014). Patients who experience readmissions have worse clinical outcomes (Burke et al., 2016), and the risk of mortality can be elevated, reaching 60% within twelve months for elderly individuals undergoing invasive mechanical ventilation (Makam et al., 2019).
Given the clinical relevance of this issue, there is a gap in the literature regarding the investigation of potentially modifiable factors that allow for the early identification of patients at higher risk of readmission or unexpected death during hospitalization in transition hospitals. The ability to identify these patients at the time of admission is crucial for the introduction of mitigation strategies that can reduce the occurrence of unfavorable outcomes.
In this context, the present research is justified by the need to develop tools that assist in risk stratification and clinical decision support in post-acute care settings. The objective of this study is to create and analyze the performance of predictive models for adverse outcomes, characterized by transfer to a general hospital or unexpected death, based on variables collected at the time of admission of a population of patients admitted for rehabilitation in a transition hospital. To this end, the discrimination and interpretability capabilities of machine learning models will be evaluated, namely: logistic regression, decision tree, random forest, and XGBoost.
2. Material and Methods
The present study was characterized as an observational study, of the retrospective cohort type, with the purpose of creating and analyzing the performance of predictive models for adverse outcomes. The methodological approach employed machine learning techniques to identify risk factors. The research was approved by an ethics in research committee, under number 53032821.0.0000.0047, with waiver of Informed Consent Form. The data were treated in a pseudonymous manner, with restricted access to researchers, ensuring the secrecy and confidentiality of patient information.
The unit of analysis consisted of patients admitted for rehabilitation in a transitional hospital, a private institution with 60 beds, offering uninterrupted medical and nursing care. All patients admitted for rehabilitation in this hospital between July 2017 and December 2024 were included. Patients admitted for palliative care were excluded from the sample. For patients with multiple admissions, only the first admission was considered.
The data were collected from a database extracted from digital patient records. The information was pseudonymized. The variables collected included clinical data on comorbidities, history of acute hospitalization in a general hospital, and admission information at the transition hospital. Patient functionality was measured by the Functional Independence Measure (FIM) scale, with values ranging from 18 to 126. Admission diagnoses were categorized according to the International Classification of Diseases (ICD-10).
The main outcome of the study was categorized into two classes: favorable and unfavorable. The favorable outcome comprised medical discharge and expected death, while the unfavorable outcome included transfer to a general hospital or unexpected death. Readmission was considered any unscheduled transfer to general hospitals during the stay at the transition hospital, excluding elective transfers for scheduled examinations or procedures. Unexpected death was defined as any patient death without a prior palliative care definition, even if admitted for rehabilitation.
For the database treatment, a preprocessing was performed to handle missing values and encoding of categorical variables. For the MIF variable, the 3% of missing values were replaced by the mode. In the variables “wound” and “previous hospitalizations in the last 12 months”, the 7% and 1% of missing values, respectively, were assigned as zero. The 10% of missing values in the CID variable were categorized as “others”, and the 0.4% of missing values in the “origin unit” variable were filled with the most frequent value. Categorical variables, such as profile, origin unit, and CID, were converted into dummy variables through one-hot encoding.
Initially, descriptive and univariate analyses of the population were performed to characterize the patients. To compare categorical variables, the chi-squared test was used. For continuous variables, the Mann-Whitney test was employed. These preliminary analyses aimed to understand the distribution of variables and their initial associations with the outcome.
For the construction of the predictive models, the sample was divided into training (70% of individuals) and test (30% of individuals) subsets. Four statistical and machine learning models were implemented and compared: Logistic Regression, Decision Tree, Random Forest, and XGBoost. Hyperparameter optimization for each model was performed using the gridsearch technique, combined with k-fold cross-validation. Additionally, a decision threshold calibration strategy was applied.
Model interpretability was addressed with SHAP (SHapley Additive exPlanations) technology. The global variable importance ranking was evaluated through Bar-Plot and Beeswarm graphs, and a local explanation analysis was performed on XGBoost with Waterfall graphs. Model calibration was compared by the area under the ROC curve, using paired difference analysis via bootstrapping with 1000 repetitions. The analyses were performed in Python® version 3.12.7, in the Spyder 5.5.1 IDE environment, using libraries such as pandas, numpy, matplotlib, seaborn, statsmodel, statstests, sklearn, scipy, xgboost, and shap. Script verification and optimization were assisted by the artificial intelligence model Gemini (Google, 2024).
3. Results and Discussion
The present investigation revealed that the occurrence of unfavorable outcomes, characterized by hospital readmission or unexpected death, is a frequent reality in patients admitted for rehabilitation in transitional hospitals. Of the 1,306 patients included in the final analysis, after excluding 1,318 admissions based on specific criteria, 375 individuals, corresponding to 29% of the sample, presented an unfavorable outcome. The majority of these events were attributed to transfers to high-complexity hospitals, which accounted for 26% of the total, while unexpected deaths represented 2.7%.
Univariate descriptive analyses identified several variables significantly associated with the unfavorable outcome. Patients who experienced adverse outcomes were, on average, older (68.6 years versus 66.1 years, p=0.005) and presented lower functionality at admission, according to the MIF scale (40.3 versus 52.5, p<0.001). Additionally, the length of hospital stay at the referring hospital was longer (42.1 days versus 32.0 days, p<0.001) and the number of comorbidities was higher (3.1 versus 2.6, p<0.001) in the group with unfavorable outcomes.
Regarding categorical variables, the care appropriateness profile, the presence of enteral feeding, tracheostomy, and the occurrence of pressure injuries at admission were associated with unfavorable outcomes with statistical significance (p<0.001 for all). For example, 49.9% of patients with unfavorable outcomes had a care appropriateness profile, compared to 34.2% in the favorable group. The presence of pressure injuries was observed in 61.1% of patients with unfavorable outcomes, versus 41.4% in the group with favorable outcomes.
The origin unit also proved to be a relevant factor, with patients from the Intensive Care Unit (ICU) presenting a significantly higher proportion of unfavorable outcomes (42.7% versus 24.7% for favorable outcome, p<0.001). Certain diagnostic categories, according to the International Classification of Diseases (ICD-10), such as Neoplasms (group C), Diseases of the Respiratory System (group J), Diseases of the Digestive System (group K), and Diseases of the Musculoskeletal System and Connective Tissue (group M), also showed an association with adverse outcomes.
Regarding predictive modeling, multivariate logistic regression, used for explanatory purposes, resulted in a final model with ten variables. This model demonstrated an accuracy of 74.43%, with a precision of 61% and a recall of 30%. The area under the ROC (Receiver Operating Characteristic) curve was 0.736, with a 95% confidence interval between 0.706 and 0.766. The model’s calibration was considered good, according to the Hosmer-Lemeshow test, which presented a p-value of 0.887.
The variables identified as independent predictor variables in the logistic regression model included functional status at admission (MIF), the number of comorbidities, the presence of wounds (pressure injury), length of stay in the referring hospital, enteral diet, care appropriateness profile, ICU origin, and diagnostic groups C (Neoplasms), K (Diseases of the Digestive System), and M (Diseases of the Musculoskeletal System and Connective Tissue). Functional status at admission (MIF) showed an Odds Ratio (OR) of 0.98, indicating that the lower the functional status, the higher the risk of an unfavorable outcome. Wounds (pressure injury) and ICU origin showed ORs of 1.81 and 1.80, respectively, both with p<0.001, evidencing their significant impact.
The implementation of the decision tree model, aiming to enhance predictive capability, especially recall, resulted in an accuracy of 69% on the test set. The area under the ROC curve for this model was 0.657, with a precision of 45% and a recall of 30%. The accuracy on the training set was 78%, while on the test set it was 69%, suggesting the absence of significant overfitting. The tree was optimized using the Gini criterion, a depth of seven, and a minimum of ten leaves.
The Random Forest model, applied in sequence to seek performance improvements, initially presented an accuracy of 70%, with a precision of 47% and a recall of 34%. After hyperparameter optimization via gridsearch and k-fold cross-validation, the best configuration achieved a depth of five and five hundred estimators. The optimized performance resulted in a balanced accuracy of 62.7%, a precision of 42.4%, and a recall of 56.6%.
Sensitivity analysis with different thresholds for the Random Forest model indicated that a 40% threshold was the most clinically appropriate, prioritizing risk identification (recall of 84% and precision of 37%). The area under the ROC curve for this model on the test set was 0.707, with a 95% confidence interval between 0.653 and 0.762. The most important variables for the Random Forest model, according to the Gini Importance score, were functionality at admission (MIF), length of stay at the referring hospital, and age at admission.
The XGBoost algorithm was the model that demonstrated the best predictive performance. After hyperparameter optimization, a balanced accuracy of 64.9% was obtained on the test set, with a gap of 7.5% compared to the training set, considered acceptable and indicative of absence of overfitting. The decision threshold of 35% was identified as having the best metrics, resulting in a balanced accuracy of 63%, recall of 90%, and precision of 36%.
The area under the ROC curve for the XGBoost model on the test set was 0.723, with a 95% confidence interval between 0.666 and 0.774. SHAP analysis, used to interpret the impact of variables, confirmed that admission functionality (MIF), the presence of pressure injuries, and ICU origin were the variables with the greatest predictive impact. These variables are consistent with the findings of Logistic Regression, reinforcing their theoretical rationale as markers of fragility and clinical complexity.
The comparison between the models revealed that XGBoost showed statistical superiority over Decision Tree and Random Forest. The average gain in the area under the ROC curve of XGBoost over Decision Tree was 0.079 (p=0.006), and over Random Forest was 0.015 (p=0.046). This result suggests that the algorithmic complexity of gradient boosting models, such as XGBoost, adds significant value in risk prediction compared to simpler or less regularized models.
The discriminative performance of the XGBoost model, with an AUC of 0.723, is considered satisfactory and comparable or superior to that of other studies in the literature addressing unfavorable outcomes in post-acute patients (Hoyer et al., 2014; Chandra et al., 2019). Although some studies have reported higher AUCs, it is important to note that they often employed class balancing techniques or focused on very specific populations, which may introduce bias or limit the generalization of the results (Mohanty et al., 2021; Scrutinio et al., 2020).
The decision not to use over- or undersampling techniques in the present study was deliberate, aiming to preserve the representativeness of the phenomenon’s reality and avoid potential biases in data interpretation. Model adjustment through hyperparameter tuning and threshold calibration was the adopted strategy to optimize performance, resulting in a reasonable AUC and adequate calibration for a complex clinical population, where extrinsic factors can influence outcomes.
The predictor factors of unfavorable outcomes identified, such as functional status on admission (MIF), the presence of pressure injuries, and origin from the ICU, are consistently pointed out in the literature as markers of frailty and clinical complexity. Functional dependence is associated with a higher probability of readmission (Hoyer et al., 2014; Li et al., 2021; Shih et al., 2016), and pressure injuries are a risk factor for hospital readmissions (Bogaisky & Dezieck, 2015; Burke et al., 2016; Mohanty et al., 2021; Wang et al., 2022). Origin from the ICU is also an indicator of clinical instability and risk of complications (Burke et al., 2016; Ramos et al., 2024; White et al., 2011).
These findings reinforce the thesis that clinical severity and frailty markers are crucial in predicting adverse events in patients undergoing rehabilitation in transitional hospitals. The ability to identify these high-risk patients at admission is fundamental for implementing mitigation strategies, which may include more intensive interventions, enhanced monitoring, or adjustments to the care plan. The consistency of the results with existing literature validates the clinical relevance of the identified factors and the utility of the proposed models.
In summary, the research demonstrated that unfavorable outcomes are common in transition hospitals, and that machine learning models, particularly XGBoost, can effectively stratify the risk of these events. Admission functionality variables, pressure injuries, and ICU origin were consistently identified as the main predictors, offering robust support for clinical decision-making in the early identification of vulnerable patients and risk mitigation, thus responding to the objective of creating and analyzing the performance of predictive models for adverse outcomes.
4. Conclusion
The present study sought to create and analyze the performance of predictive models for adverse outcomes, such as transfer to a general hospital or unexpected death, in patients admitted for rehabilitation in a transition hospital, using variables collected at admission. It was found that unfavorable outcomes were frequent, reaching 29% of the sample, predominantly due to hospital transfers. The analyses identified that admission functionality (MIF scale), the presence of pressure injuries, and origin from the Intensive Care Unit (ICU) were the variables with the greatest predictive impact for these events. Among the machine learning models evaluated – Logistic Regression, Decision Tree, Random Forest, and XGBoost – the XGBoost algorithm demonstrated the best discriminative performance, with an area under the ROC curve of 0.723, being statistically superior to the Decision Tree and Random Forest models. These findings offer robust support for clinical decision-making, enabling effective risk stratification in post-acute settings and early identification of vulnerable patients, which is fundamental for the implementation of risk mitigation strategies.
A limitation of the present study lies in the need for external validation of the models, as well as in the generalization of the findings to other patient populations in transitional hospitals. The methodological decision not to employ class balancing techniques aimed to preserve the representativeness of the phenomenon, although it may have influenced the magnitude of the area under the ROC curve. It is suggested that future studies explore the application and validation of these models in different clinical and geographical contexts, in addition to investigating the effectiveness of implementing interventions based on risk stratification to mitigate unfavorable outcomes.
Bibliographic References
BOGAISKY, M.; DEZIECK, L. 2015. Early hospital readmission of nursing home residents and community-dwelling elderly adults discharged from the geriatrics service of an urban teaching hospital: patterns and risk factors. Journal of the American Geriatrics Society 63(3): 548-552.
BURKE, R.E.; WHITFIELD, E.A.; Hittle, D.; Min, S.j.; et al. 2016. Hospital readmission from post-acute care facilities: risk factors, timing, and outcomes. Journal of the American Medical Directors Association 17(3): 249-255.
Chandra, A.; Rahman, P.A.; SNEVE, A.; MCCOY, R.G.; et al. 2019. Risk of 30-day hospital readmission among patients discharged to skilled nursing facilities: development and validation of a risk-prediction model. Journal of the American Medical Directors Association 20(4): 444-450.
FU, J.B.; LEE, J.; SMITH, D.W.; SHIN, K.; et al. 2014. Frequency and reasons for return to the primary acute care service among patients with lymphoma undergoing inpatient rehabilitation. PM & R: The Journal of Injury, Function, and Rehabilitation 6(7): 629-634.
Google, 2024 [Referência completa não encontrada no documento original]
HORNEY, C.; CAPP, R.; BOXER, R.; BURKE, R.E. 2017. Factors associated with early readmission among patients discharged to post-acute care facilities. Journal of the American Geriatrics Society 65(6): 1199-1205.
HOYER, E.H.; NEEDHAM, D.M.; ATANELOV, L.; KNOX, B.; et al. 2014. Association of impaired functional status at hospital discharge and subsequent rehospitalization. Journal of Hospital Medicine 9(5): 277-282.
KAHN, J.M.; BENSON, N.M.; APPLEBY, D.; CARSON, S.S.; et al. 2010. Long-term acute care hospital utilization after critical illness. JAMA 303(22): 2253-2259.
LEE, J.T.; MIKKELSEN, M.E.; QI, M.; WERNER, R.M. 2020. Trends in post-acute care use after admissions for sepsis. Annals of the American Thoracic Society 17(1): 118-121.
LI, C.Y.; HAAS, A.; PRITCHARD, K.T.; KARMARKAR, A.; et al. 2021. Functional status across post-acute settings is associated with 30-day and 90-day hospital readmissions. Journal of the American Medical Directors Association 22(12): 2447-2453.e2445.
MAKAM, Α.Ν.; GRABOWSKI, D.C. 2021. Policy in clinical practice: choosing post-acute care in the new decade. Journal of Hospital Medicine 16(3): 171-174.
MAKAM, Α.Ν.; TRAN, T.; MILLER, M.E.; XUAN, L.; et al. 2019. The clinical course after long-term acute care hospital admission among older medicare beneficiaries. Journal of the American Geriatrics Society 67(11): 2282-2288.
MOHANTY, S.D.; LEKAN, D.; MCCOY, T.P.; JENKINS, M.; et al. 2021. Machine learning for predicting readmission risk among the frail: explainable Al for healthcare. Patterns 3(1): 100395.
OTTENBACHER, K.J.; KARMARKAR, A.; GRAHAM, J.E.; KUO, Y.F.; et al. 2014. Thirty-day hospital readmission following discharge from postacute rehabilitation in fee-for-service medicare patients. JAMA 311(6): 604-614.
RAMOS, J.G.R.; DE SOUZA, M.J.; REZENDE, A.S.; FERREIRA, F.S.; et al. 2024. Clinical trajectories of critically ill patients discharged directly from a critical unit to a postacute care facility: retrospective cohort. Critical Care Science 36: e20240015en.
SCRUTINIO, D.; RICCIARDI, C.; DONISI, L.; LOSAVIO, E.; et al. 2020. Machine learning to predict mortality after rehabilitation among patients with severe stroke. Scientific Reports 10: 20127.
SHIH, S.L.; ZAFONTE, R.; BATES, D.W.; GERRARD, P.; et al. 2016. Functional status outperforms comorbidities as a predictor of 30-day acute care readmissions in the inpatient rehabilitation population. Journal of the American Medical Directors Association 17(10): 921-926.
WANG, X.; EZEANA, C.F.; WANG, L.; PUPPALA, M.; et al. 2022. Risk factors and machine learning model for predicting hospitalization outcomes in geriatric patients with dementia. Alzheimer’s & Dementia: Translational Research & Clinical Interventions 8(1): e12351.
WHITE, A.C.; JOSEPH, B.; PERROTTTA, B.A.; GRANDFIELD, J.; et al. 2011. Unplanned transfers following admission to a long-term acute care hospital: a quality issue. Chronic Respiratory Disease 8(4): 245-252.
Article originating from the Final Course Work of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform