Predicting and Explaining Medical Students’ Psychological Resilience: A Dual Perspective of Machine Learning and Path Analysis

In their article “The secrets of medical students’ psychological resilience: A dual perspective of machine learning and path analysis,” Su and colleagues tackle a problem that is increasingly central to medical education: how to identify, understand, and strengthen psychological resilience among medical students in a rigorous, data-driven way (Su et al., 2026). Against the backdrop of rising mental health problems and even elevated suicide risk among healthcare professionals, they argue that resilience is not a vague personality trait but a measurable, modifiable resource that can be modeled and targeted through interventions.

Psychological resilience is defined here as the capacity to adapt and recover in the face of adversity, with better-than-expected functioning given one’s context. For medical students, this means being able to sustain motivation, engagement, and emotional balance despite heavy academic demands, uncertain career prospects, and sometimes tense doctor–patient relations. Previous work has shown that higher resilience is associated with less academic burnout, lower stress and better professional identity, while low resilience amplifies vulnerability to anxiety, depression, and impaired performance. Su et al. position medical students as “future healthcare workers” whose resilience is not only personally protective but also a strategic resource for the mental health of the workforce and the robustness of health systems.

The distinctive contribution of the study lies in its dual perspective: the authors deliberately combine a predictive, machine-learning view with an explanatory, path-analytic view. In other words, they first ask “Can we accurately identify students at high risk of low resilience using routine data?” and then ask “Through which psychological mechanisms does resilience emerge or erode?” The machine learning perspective focuses on classification and risk prediction; the path analysis perspective focuses on causal pathways and mediation. Together, these two lenses move the paper beyond traditional regression-only studies: one part helps universities build early-warning systems, while the other part tells them what to actually change.

Empirically, the study draws on a cross-sectional sample of 843 undergraduate medical students from a single Chinese medical university. Participants completed a battery of validated instruments: the 14-item Resilience Scale (RS-14) to classify psychological resilience into low, moderate, and high categories; the Perceived Social Support Scale (PSSS); the Smartphone Addiction Scale – Short Version (SAS-SV); and the Pittsburgh Sleep Quality Index (PSQI) to assess sleep disturbance. Demographic and background factors such as grade, gender, ethnicity, family economic status, and BMI were also recorded. In this sample, resilience scores ranged between 14 and 98 with a mean of 72.2, but critically, 30.2% of students fell into the “low resilience” group. Mean perceived social support was high (67.7 out of 84), whereas smartphone addiction (mean 27.7) and sleep disturbance (mean 4.1) pointed to non-trivial behavioral risks.

Before building prediction models, the authors used LASSO regression to select the most informative predictors out of twelve candidate variables. This penalized regression approach shrinks unimportant coefficients towards zero, reducing multicollinearity and overfitting. With the optimal penalty parameter (λ = 0.04175), four predictors survived: perceived social support, smartphone addiction, sleep disturbance, and grade. These four variables thus constitute the core “risk signature” of low resilience in this cohort.

On the machine learning side, four algorithms were trained to predict low versus non-low resilience: logistic regression, decision tree, random forest, and Extreme Gradient Boosting (XGBoost). Five-fold cross-validation, bootstrap-based confidence intervals, and standard metrics were used for evaluation. XGBoost clearly outperformed the others, with an accuracy of 0.822, AUC of 0.856, sensitivity of 0.609, specificity of 0.902 and F1 score of 0.700 on the test set. Logistic regression had a comparable AUC but markedly lower sensitivity (0.464), while the tree-based models offered somewhat more balanced sensitivity and specificity at the cost of overall accuracy. The authors are transparent about one limitation: all four models struggle more with correctly flagging low-resilience students (sensitivity) than with reassuringly identifying non-low-resilience students (specificity).

Importantly, the authors do not stop at “black-box” prediction. They use SHapley Additive exPlanations (SHAP) to interpret the XGBoost model, quantify feature importance, and visualize how specific values of each variable change the predicted risk for each student. SHAP feature rankings show perceived social support as the dominant protective factor, followed by smartphone addiction and sleep disturbance as key risk factors; grade has a smaller but non-negligible protective effect. SHAP summary and dependence plots reveal clinically intuitive thresholds: perceived social support around 70 sharply reduces the probability of low resilience; smartphone addiction scores above roughly 30 sharply increase it; and a PSQI score above about 5 marks a tipping point from healthier to more problematic sleep with corresponding increases in low-resilience risk. These visualizations translate complex model behavior into actionable thresholds that can be used in screening and intervention design.

The correlational structure behind these variables is also clearly described. Controlling for grade, ethnicity, and family economic status, perceived social support correlates positively with resilience (r ≈ 0.58) and negatively with both smartphone addiction and sleep disturbance. Smartphone addiction, in turn, correlates negatively with resilience and positively with sleep disturbance, and sleep disturbance correlates negatively with resilience. These patterns already suggest a plausible mechanism: low social support → more smartphone addiction and worse sleep → lower resilience.

This is where the second half of the dual perspective comes in. Using PROCESS Model 6, the authors specify a chain mediation model with perceived social support as the predictor, smartphone addiction and sleep disturbance as sequential mediators, and psychological resilience as the outcome. Grade, ethnicity, and family economic status are included as control variables. In this model, perceived social support directly predicts resilience (β = 0.531, p < 0.001), while also negatively predicting smartphone addiction (β = −0.371) and sleep disturbance (β = −0.039). Smartphone addiction positively predicts sleep disturbance (β = 0.110) and negatively predicts resilience (β = −0.354), and sleep disturbance itself negatively predicts resilience (β = −0.761), all with strong statistical significance.

Bootstrap mediation analysis (5,000 resamples) shows that the total effect of perceived social support on resilience is 0.723, with 73.44% of this effect being direct and 26.56% mediated. Three specific indirect paths are significant, with confidence intervals not crossing zero: via smartphone addiction alone (18.12% of total effect), via sleep disturbance alone (4.15%), and via the chained path “social support → smartphone addiction → sleep disturbance → resilience” (4.29%). In other words, about a quarter of the resilience-promoting effect of social support operates through reducing problematic smartphone use and improving sleep quality, and these two behavioral pathways also reinforce each other. This neatly complements the SHAP patterns, which had already highlighted the same variables as key levers.

The dual perspective therefore yields a layered understanding. From the machine-learning view, academic administrators get a pragmatic tool: with a small set of routinely collectable variables, they can build a reasonably accurate risk calculator to flag students who might benefit from closer follow-up. From the path-analysis view, they get a mechanism: interventions that strengthen social support networks, address smartphone overuse, and improve sleep hygiene are likely to have the strongest impact on resilience. The two perspectives are mutually reinforcing: XGBoost plus SHAP identifies whom to worry about and where the thresholds lie; mediation analysis clarifies why these patterns emerge and how to design psychologically meaningful interventions.

Practically, the findings point to several clear directions. First, perceived social support deserves explicit institutional attention, not just as a soft “nice-to-have” but as a measurable determinant of resilience. Mentoring schemes, peer-support groups, and family-involving communication strategies can be framed as resilience-building rather than solely as pastoral care. Second, smartphone addiction is not an isolated “digital hygiene” problem; it is embedded in a broader stress–support–sleep triangle. Students with low support may compensate by turning to virtual connections, which then erode sleep and, ultimately, resilience. Interventions that only focus on screen time without addressing underlying feelings of isolation or low belonging are unlikely to succeed. Third, sleep education and structural changes that enable regular, adequate sleep (e.g., scheduling, exam clustering, call patterns during clinical years) should be treated as core components of mental health promotion rather than lifestyle extras.

The authors are cautious about overclaiming. They acknowledge that the data are cross-sectional and come from a single institution, which limits causal inference and generalizability. They explicitly call for multi-center studies, external validation of the prediction model, exploration of transfer learning to other populations, and longitudinal designs to track resilience trajectories over time. They also note the relatively modest sensitivity of the model, hinting that additional predictors – such as detailed academic performance, personality traits, or biological measures – could enhance detection of low-resilience students. At the same time, their framework is modular: new predictors and more sophisticated models can be plugged into the same dual-perspective logic.

In sum, this study shows how modern data science and classic psychological modeling can be combined to illuminate “the secrets” of medical students’ resilience. It demonstrates that resilience is strongly shaped by perceived social support, smartphone use patterns, and sleep quality; that these factors interact in a chain from social context to digital habits to sleep; and that machine learning models such as XGBoost, when carefully interpreted, can move mental health screening beyond static questionnaires. For medical schools and health systems that are serious about building a resilient workforce, Su et al. offer both a radar and a roadmap (Su et al., 2026).

Reference: Su, W., Jia, H., Chang, W., Jiang, S., Dong, S., Ge, H., Qi, Y., Li, X., & Ma, G. (2026). The secrets of medical students’ psychological resilience: A dual perspective of machine learning and path analysis. International Journal of Medical Informatics, 205, 106111. https://doi.org/10.1016/j.ijmedinf.2025.106111

Subscribe to the Health Topics Newsletter!

Google reCaptcha: Invalid site key.