Fig. 2: Diagnostic associations with delirium show enrichment of known risk factors of delirium.

a UMAP representation of all first-time, non-delirium diagnoses prior to the inpatient visit of interest. Each dot represents a patient (salmon = 7492 patients with delirium, gray = 7492 control patients). Violin plots showing distribution of patients across UMAP component 1 (left) and 2 (right). p-values determined by two-sided Mann–Whitney U-tests. ****p-value < 2.2 × 10−16; **p-value 0.0086. b Volcano plot of differential comorbidities, with diagnoses enriched in controls in black (108 diagnoses) and in delirium patients in salmon (101 diagnoses) and non-significant diagnoses in gray. Significance determined by two-sided Fisher’s exact test with Bonferroni-corrected p-value < 0.05 (at dotted horizontal line). OR = odds ratio. Most significant diagnoses highlighted by name. c ICD10-diagnostic block representation of significant differential comorbidities identified in b for patients with delirium. d Table showing number of diagnoses overlapping between UCSF and UC-Wide datasets in each ICD10 block for each patient group. Entries with at least 3 or more diagnoses in one patient group compared to the other are colored. Hypergeometric test used to evaluate overlap between the two datasets (p-value 1.2 × 10−94). e Log–log plot comparing differential diagnoses between UCSF and UC-Wide databases. Each dot represents a differential diagnosis that is significantly different between delirium versus control patients in either dataset (gray) or in both datasets (salmon for enrichment in delirium group, black for enrichment in control group) databases. Axis values represent log base 2 of the odds ratio between delirium versus control patients in the UC-Wide dataset on the x-axis and the UCSF dataset on the y-axis. Spearman correlation ρ = 0.94 when looking at points significant in both datasets. Dotted line represents perfect correlation between the magnitude of the odds ratios between the two datasets. f Zoomed in plot of the yellow-highlighted portion of plot in e to focus on the differential diagnoses significantly enriched in the delirium group, with gray representing diagnoses significant in either dataset and salmon representation diagnoses significant in both datasets. Diagnoses with the largest odds ratios are highlighted. See also Supplementary Fig. 3 and Supplementary Data 2-4. UMAP Uniform Manifold Approximation and Projection, EHR electronic health record, ICD10 International Classification of Diseases, 10th Revision, UC University of California, UCSF University of California San Francisco, MSK musculoskeletal, SIRS systemic inflammatory response syndrome.