Our analyses included 18,385 BioVU patients. These patients had a median EHR length of 9.91 years (range <1–27 years; Supplementary Table 4), the average median age across the EHR was 57.2 years (SD 17.6), and 50.9% of patients were female. Nearly 5% of patients were diagnosed with MDD, 24.9% had depressive symptoms, and 39.5% had evidence of any psychiatric symptoms. While the genome-wide genetic correlation between MDD and loneliness was 0.64 [10], the polygenic scores for MDD and loneliness had a Pearson correlation of 0.18 (Supplementary Table 5).