This study has two components with different reporting requirements, and we follow the relevant guideline for each. The primary component—an observational registry analysis of the association between hospital level and mortality—is reported in accordance with STROBE13. The prediction-model component is reported in accordance with TRIPOD+AI14, which supersedes the 2015 TRIPOD statement and covers regression and machine-learning models alike. TRIPOD+AI also asks explicitly how clustered data are handled in model development and validation; our answer is given in Sects. “Clustering” and “Construction of cross-validation folds”. Completed checklists for both guidelines, mapping each item to the section that addresses it, are supplied with this submission.

Patients studied

The National Patient Registry (NPR) includes all inpatient hospital admissions in Sweden and was used to identify trauma-related admissions between 2008 and 2021. Using each patient’s personal identification number (PIN), the NPR was linked to the Cause of Death Registry to ascertain mortality irrespective of place of death. Because emergency-department encounters are recorded as outpatient care in Sweden, the cohort is conditional on survival to inpatient admission; prehospital and emergency-department deaths are not captured.

We constructed an initial trauma database using International Classification of Diseases, 10th Revision (ICD-10) codes for injuries (S00–T79) and external causes (V01–Y98). Codes T360–T790 (except T689, hypothermia) were excluded because they primarily represent poisoning, intoxication, and other adverse effects not considered trauma-related in this context. Assault-related admissions were defined using ICD-10 external-cause codes X93–X96, X99, Y00, Y04, Y07–Y09, Y22–Y25, Y28–Y29, Y350, Y353–Y354, Y364, W32–W34, and W50. Codes X85–X92, X97–X98, Y01–Y03, and Y05–Y06 were excluded because they represent mechanisms outside the scope of this study (e.g. pesticide assault, sexual abuse, and neglect). The final study population comprised 28 677 assault-related hospital admissions in 25 641 individuals. A flowchart of cohort selection is shown in Fig. A1.

Mechanism classification: three strata

The external-cause code does not specify a mechanism for every assault admission. Pooling those unclassified admissions with blunt trauma, as a two-group “penetrating versus blunt” split requires, does not yield a mechanism contrast: the resulting group is a mixture whose composition is unknown. We therefore classify admissions into three mutually exclusive strata and analyse each separately:

  • Penetrating (\(n=6\,072\); 21.2%): firearm-related (X93–X95, Y22–Y24, Y350, Y364, W32–W34; \(n=1\,776\)) and sharp-object injuries (X99, Y28, Y354; \(n=4\,296\)).

  • Blunt (\(n=12\,092\); 42.2%): Y00, Y04​, Y29, Y353, W50.

  • Undefined mechanism (\(n=10\,494\); 36.6%): assault-related external-cause codes that do not specify a physical mechanism.

Every admission carries exactly one recorded assault-type code, so the three strata plus 19 explosive-injury admissions (0.1%) account for the whole cohort (\(6\,072 + 12\,092 + 10\,494 + 19 = 28\,677\)). The explosive-injury admissions were too few to model and are described separately, leaving 28 658 admissions in the mechanism-stratified models.

A separate registry flag identifies 258 admissions (0.9%) that additionally carry an assault code from a second mechanism group. Because each of these admissions nonetheless has a single recorded assault type, we retain them in the primary analysis and report their exclusion as a sensitivity analysis (Appendix Table A6); it changes no hospital-level estimate by more than 0.02 on the odds-ratio scale.

There were no missing values for age, sex, comorbidity, calendar year, hospital level, ICISS or the outcome, and no imputation was required.

Pooling the undefined stratum with blunt trauma is reported as a sensitivity analysis, so that the consequence of the stratification choice can be seen directly.

Hospital categorisation and the exposure

Hospital categories follow the classification used by Ydenius et al.8: Level 1, university hospitals; Level 2, regional hospitals; Level 3, local county hospitals. The cohort was treated at 67 hospitals (10 Level 1, 21 Level 2, 36 Level 3).

The exposure is the level of the first receiving hospital, assigned irrespective of any subsequent transfer. This is an intention-to-treat analogue and is the primary specification. Transfer is a post-baseline consequence of hospital level, injury severity and early clinical course; conditioning on non-transfer therefore risks collider-stratification bias acting directly on the exposure–outcome relationship15,16. Two alternative assignments are reported as sensitivity analyses: restriction to admissions without transfer, and assignment by the definitive (last) treating hospital.

Outcome

The primary outcome is 30-day all-cause mortality from any location, ascertained through linkage to the Cause of Death Registry, so that deaths after discharge are captured. Of the 170 deaths within 30 days, 131 (77%) occurred during the index hospital stay and 39 (23%) after discharge. Restricting the outcome to in-hospital deaths is not neutral with respect to the exposure: the proportion of 30-day deaths occurring after discharge was 17% at Level 1 hospitals but 32% at Level 2 and 31% at Level 3 (Fig. 8C). An in-hospital-only outcome would therefore be differentially ascertained across hospital levels, and is reported here only as a sensitivity analysis.

Because discharge alive removes a patient from the in-hospital risk set, and because the cohort empties rapidly (only 25% of admissions remained in hospital by day 2), time to death is analysed in a competing-risks framework, with death as the event of interest and discharge alive as the competing event. Cumulative incidence functions were estimated with the Aalen–Johansen estimator17,18.

Severity of injury and out-of-sample ICISS

The ICD-based Injury Severity Score (ICISS), developed by Osler et al.12, is a survival-based severity score computed as the product of diagnosis-specific survival probabilities (DSPs) over all injury diagnoses recorded for an admission. ICISS encompasses all injuries sustained by a patient and is widely applicable because ICD coding is mandated in Swedish medical records; diagnosis-based severity scaling has been validated against national hospitalisation data19, and internationally comparable ICD-10 survival probabilities have been derived for cross-national use, including Swedish data20.

DSPs are estimated from the same outcome that is subsequently modelled. If they are estimated on the whole cohort and then used as a predictor of that cohort’s mortality, outcome information leaks into the predictor and all reported discrimination is optimistic by construction. Deriving DSPs from the entire database before the training/test split therefore invalidates any subsequent performance estimate. We avoid this in two ways:

  • For descriptive and regression analyses, ICISS was cross-fitted: in each of 10 folds, DSPs were estimated from the other nine folds and applied unchanged to the held-out fold, so that every admission carries an ICISS value that does not use its own outcome.

  • For prediction-model evaluation, DSPs were estimated within the training folds only and applied unchanged to the held-out data, alongside all other model fitting.

In both cases the folds are constructed as described in Sect. “Construction of cross-validation folds”, so that no individual contributes admissions to both the estimation and the evaluation set.

DSPs were computed over ICD-10 chapter XIX injury codes (S00–T98) using a Jeffreys-type estimator that keeps every probability strictly inside (0, 1), which matters because most contributing codes are sparse. All models reported in the main analysis use pooled (all-assault) DSPs; stratum-specific DSPs are reported only as a comparison in Sect. “Injury severity scoring: the cost of in-sample derivation”. Severe injury was defined as ICISS \(\le 0.85\). The estimator, the code-frequency distribution and the handling of codes unseen in a training partition are given in Supplementary Methods A.1.

Comorbidities

Comorbidity burden was assessed using the Charlson Comorbidity Index (CCI), in the ICD-10 adaptation described by Glasheen et al.21.

Statistical analysis

The logistic regression benchmark was fitted in STATA. All other analyses were performed in Python 3.11 (statsmodels 0.14, scikit-learn 1.8, XGBoost 3.2). The outcome was binary 30-day all-cause mortality.

Regression models

Multivariable logistic regression was fitted separately within each mechanism stratum, adjusting for \(\log _{10}(1-\textrm{ICISS}+0.001)\), age, sex, CCI, calendar year and hospital level, with firearm versus sharp object additionally included within the penetrating stratum. Confounders were selected a priori and are shown in the directed acyclic graph (Fig. 1); mediators of a hospital-level effect (treatment, interventions, resources) were deliberately not adjusted for.

Clustering

Admissions are clustered within 67 hospitals, and within individuals: 25 641 people account for the 28 677 admissions, so 3 036 admissions (10.6%) are in excess of one admission per person. The 2 445 individuals with more than one admission contribute 5 481 admissions in total (19.1% of the cohort). Confidence intervals in all primary models are cluster-robust with hospitals as clusters. We additionally fitted models with cluster-robust intervals at the patient level and mixed-effects logistic models with a random intercept for hospital22 (Appendix Table A8). Between-hospital heterogeneity was modest (random-intercept standard deviations 0.18–0.42 on the log-odds scale), and cluster-robust intervals were not wider than naive intervals (ratio of standard errors 0.78–0.97): in this dataset the alternative clustering specifications did not materially increase the estimated standard errors. We do not read that as showing clustering to be unimportant (Supplementary Methods A.3).

Construction of cross-validation folds

Because 2 445 individuals contribute more than one admission each, cross-validation at the level of the admission would place admissions from the same patient in both the training and the held-out set, so that held-out performance is not independent of the training data; TRIPOD+AI asks explicitly how clustered data are handled in model validation14. All cross-validation reported here therefore uses patient-grouped folds, in which every admission belonging to one individual is assigned to the same fold, both for the cross-fitting of ICISS and for the evaluation of the prediction models. Under admission-level folds, 4 898 individuals were split across the training and held-out sets summed over the ten folds; under patient-grouped folds this count is zero by construction. Results under both schemes are reported side by side in Appendix Table A7 (Supplementary Methods A.2).

Precision and minimum detectable effect

Because the number of deaths is small, we report for every hospital-level contrast a standard-error-based detectable-effect benchmark (which, for brevity, we abbreviate MDOR), defined as \(\exp \{(z_{0.975}+z_{0.80})\times \textrm{SE}(\log \textrm{OR})\}\). It is a post-data description of the precision achieved, not a prospective power calculation and not an achieved-power analysis, and it says nothing about the size of any estimate (Supplementary Methods A.4). It is tabulated for the primary models in Table 2, for every specification in Appendix Table A6, and annotated on every estimate in Fig. 4. We also report events per variable (EPV) for each model23,24.

Machine learning and model performance

XGBoost was compared with logistic regression using the same predictor set. No class weighting, up-sampling or down-sampling was applied at any stage; models were fitted and evaluated on the observed class distribution.

The comparator is \(L_2\)-penalised (ridge) logistic regression as implemented in scikit-learn, with the default inverse regularisation strength \(C=1\) and predictors entered on their original scales without standardisation. The penalty is not neutral: with unstandardised predictors it shrinks coefficients unequally across variables. XGBoost hyperparameters were fixed in advance and not tuned (250 trees, maximum depth 3, learning rate 0.05, subsample 0.8, column subsample 0.8, \(\lambda =1\)); no hyperparameter search was performed, so the comparison is between one fixed gradient-boosting configuration and one fixed penalised regression, not between model classes.

Primary evaluation. All performance quantities come from a single designated primary patient-grouped 10-fold partition of the full cohort (Sect. “Construction of cross-validation folds”), with DSPs, ICISS and all model parameters estimated within training folds only. The partition was not specified in advance of examining the data; it was fixed under a documented random seed so that the evaluation is exactly reproducible and cannot be selected post hoc from among candidate partitions. Discrimination, its confidence interval, the paired model comparison, the Brier score, the scaled Brier score and the calibration statistics are all computed from the same pooled out-of-fold prediction vector, so that point estimates and inferential quantities refer to the same object. We report discrimination as the area under the receiver operating characteristic curve (AUC) together with the paired between-model difference; the Brier score, the Brier score of a null model predicting the marginal event rate for everyone, and the scaled Brier score (index of prediction accuracy)25,26; and calibration slope, calibration-in-the-large and calibration curves27. Their definitions are given in Supplementary Methods A.5.

Uncertainty in the presence of repeated patients. Patient-grouped folds address leakage between training and evaluation, but they do not make the held-out predictions independent of one another: admissions within the pooled out-of-fold prediction vector remain clustered by patient, and the DeLong variance—like the conventional standard errors for the Brier score and the calibration coefficients—assumes that they are not. Grouping does not by itself solve the inferential clustering problem. We therefore take the primary interval for every performance measure from a patient-level cluster bootstrap of 2 000 replicates, in which patients are resampled with replacement and all admissions belonging to a sampled patient are carried together. The procedure respects the cluster structure of the evaluation sample but conditions on the models fitted in the primary partition; variability attributable to the choice of partition is a different quantity, reported separately as a stability check over 10 independent partitions with no intervals or p-values attached (Appendix Table A7, Panel D). Conventional DeLong intervals are given beside the bootstrap intervals in Appendix Table A9. Full details are in Supplementary Methods A.6.

Shapley additive explanations (SHAP) were computed on out-of-fold predictions using TreeSHAP28,29 and are presented as a descriptive ranking of feature contributions only. We do not convert them into odds ratios, for the reason set out in Supplementary Methods A.7.

Directed acyclic graph

We constructed a directed acyclic graph (DAG) to formalise assumptions about the structure linking hospital level (exposure) and 30-day mortality (outcome) and to guide covariate adjustment (Fig. 1). Interhospital transfer is represented explicitly as a post-exposure variable on the pathway from hospital level and injury severity to the outcome, making clear why conditioning on non-transfer is a form of selection on a collider.

Because prehospital factors are not captured, and because the cohort is conditional on survival to inpatient admission, unmeasured confounding and selection bias remain. Findings should be interpreted as adjusted associations within an in-hospital-admitted population.

Ethics

The study was approved by the Swedish Ethical Review Authority (registration nos. 2019–04852 and 2021–04333) and conducted in accordance with the 1964 Declaration of Helsinki and its later amendments. Informed consent was waived by the Swedish Ethical Review Authority, in accordance with standard practice for retrospective registry-based studies, provided that data privacy, secure storage, and regulatory compliance are ensured.

Data retrieval was performed through the National Patient Registry and the Cause of Death Registry, both maintained by the National Board of Health and Welfare. Registry linkage is conducted by the authority using the PIN to ensure accurate matching across datasets. Personal identifiers are never shared with the researchers, as all data are fully anonymised prior to release. The researchers do not have access to the coding key, which is automatically and irreversibly deleted by the authorities shortly after database delivery. The National Board of Health and Welfare does not process or release any data prior to formal ethical approval.

Use of large language models

In preparing this manuscript the authors used a large language model (Anthropic Claude) for language editing and to assist with writing and reviewing the analysis code and the manuscript text. All analytic decisions—cohort definition, mechanism classification, choice of exposure and outcome, model specification, the cross-validation design, and the interpretation of every result—were made by the authors. All code was reviewed by the authors, and the reported results were checked against the code output before submission. No individual-level registry data were provided to the language model at any point; it operated on analysis code and on aggregate output only. The authors take full responsibility for the content of this article.

Fig. 1The directed acyclic graph links the level of the first receiving hospital to 30-day all-cause mortality, directly and through treatment, emergency-department care, interventions, and resources. Adjusted confounders are age, sex, comorbidity, injury severity, and injury mechanism. Geography, transport, and paramedic treatment precede hospital assignment. Interhospital transfer is a collider influenced by hospital level and injury severity; it is not conditioned on in the primary analysis.

Directed acyclic graph illustrating the hypothesised structure linking the level of the first receiving hospital (exposure) and 30-day all-cause mortality (outcome). Confounders adjusted for (age, sex, Charlson Comorbidity Index [CCI], injury severity [ICISS], injury mechanism) are shown in blue. Grey boxes denote variables not adjusted for. Variables to the left of the exposure (geography, transport, paramedic treatment) precede arrival and may confound or determine hospital assignment; variables to the right (emergency-department care, treatment, interventions, resources) occur at or after the first receiving hospital and are therefore mediators of any hospital-level effect, not confounders of it. Interhospital transfer (orange) is a common consequence of hospital level and injury severity: restricting the analysis to non-transferred admissions conditions on this collider and can induce a spurious association between exposure and outcome. The primary analysis therefore uses the full cohort assigned by first receiving hospital. Unmeasured prehospital factors and conditioning on survival to admission may introduce further selection bias.