AI Insight
This study developed and compared seven machine learning models to predict workplace bullying among 1,023 clinical nurses in Chinese hospitals, with 27.98% reporting bullying experiences. The XGBoost algorithm demonstrated the best performance with AUC values of 0.889 in training and 0.865 in validation sets, identifying seven key predictors including emotional exhaustion, weekly working hours, departmental atmosphere, and daily workload. The model was made interpretable using SHAP analysis and deployed through an interactive Shiny interface for practical use by nurse managers.
Why it matters
This predictive tool enables hospital administrators to proactively identify nurses at high risk of workplace bullying before it occurs, allowing for targeted interventions and support. By addressing workplace bullying more effectively, healthcare institutions may improve nurse retention, mental health outcomes, and potentially enhance patient care quality and safety.
Understand the Science
BackgroundWorkplace bullying harms nurses’ physical and mental health and may compromise care quality and patient safety. Previous studies have investigated its associated factors mainly with traditional statistical methods. However, such models are limited in identifying risk at the individual level, whereas machine learning offers a new way to identify nurses at risk of workplace bullying.ObjectiveThis study aimed to develop prediction models for workplace bullying among clinical nurses using seven machine-learning algorithms, compare their performance to identify the best-performing model, and combine Shapley Additive Explanations (SHAP) with Shiny to visualize the optimal model.MethodsBetween August and September 2025, clinical nurses were recruited by convenience sampling from three tertiary general hospitals in central China and completed the Negative Acts Questionnaire-Revised online. Participants were randomly allocated to training and validation sets at a 7:3 ratio. Variables were selected by univariate analysis, LASSO regression and the Boruta algorithm (R 4.4.2). Seven models were developed in Python 3.10: logistic regression (LR), decision tree (DT), random forest (RF), support vector machine (SVM), extreme gradient boosting (XGBoost), Light Gradient Boosting Machine (LightGBM), and K-nearest neighbors (KNN). Performance was compared by the area under the curve (AUC), sensitivity, specificity, calibration and decision curve analysis. The best-performing model was interpreted with SHAP and displayed through a Shiny interface.ResultsWorkplace bullying was reported by 286 nurses (27.98%), and seven predictors were retained: weekly working hours, emotional exhaustion, working years, technical title, position, departmental atmosphere and daily workload. AUC ranged from 0.798 to 0.889 in the training set and from 0.775 to 0.887 in the validation set. XGBoost showed relatively stable discrimination across the two sets (0.889 and 0.865) together with favorable sensitivity, specificity and calibration, and was selected as the final model. Furthermore, SHAP analysis indicated that emotional exhaustion, departmental atmosphere, daily workload and weekly working hours contributed most to its predictions.ConclusionThe XGBoost model showed acceptable discrimination and calibration; its risk estimates may help nurse managers identify clinical nurses at high risk of workplace bullying. Meanwhile, nurse managers should pay attention to clinical nurses at high risk and provide targeted support accordingly.