Introduction

Reports of increased mood and anxiety disorders during the COVID-19 pandemic raised interest in the mental health impact of COVID-19. The World Health Organization reported a 27.6% increase in depression and a 25.6% increase in anxiety in 2020 compared to 2019 [1], and the Centers for Disease Control and Prevention reported significant increases in anxiety and depression from August 2020 to February 2021 [2]. Some studies have suggested that this increase may be due to a direct association between COVID-19 infection and psychiatric sequelae [3,4,5,29, 30]. We accounted for this by comparing patients hospitalized with COVID-19 with patients hospitalized with other respiratory infections and found a similar temporal pattern of risk and observed the same pattern. In addition, undiagnosed or undocumented SARS-CoV-2 infections in the control cohorts undoubtedly increased during the pandemic, which could produce a decrease in HRs if COVID-19 itself is indeed a risk for subsequent anxiety and depression. Our study partially accounted for this by excluding positive antibody test results for SARS-CoV-2 before December 11, 2020, within the control cohorts to capture natural infection before vaccines were introduced. Additionally, if increasing undetected COVID-19 infections occurred in the control cohort and such infection was driving the outcome, we would expect to see an associated rise in the proportion of control patients who developed a depressive or anxiety disorder, which was not the case. Another explanation we considered was bias of ascertainment, or the possibility that COVID-19 patients received more medical follow-up and thus more opportunities for a mood or anxiety disorder to be detected, leading to elevated HRs. Indeed, COVID-19 patients had a greater number of follow-up visits on average throughout the study period, even when the HR was not significantly elevated. If increased follow-up among COVID-19 patients was responsible for elevated HRs, we would expect excess hazard to be present throughout the entire study period. Additionally, analyses comparing COVID-19 patients to bone fracture patients, a group that also requires follow-up, revealed similar temporal patterns.

Our results on risk stratified by age show a consistent elevation in older patients. While higher rates of anxiety and depressive symptoms have been reported among younger adults during the pandemic [8, 9, 31, 32] and were emphasized in the lay press, our study found older adults to be at increased absolute risk, contributing to a growing body of literature pointing to inconsistencies in the reported prevalence of mood and anxiety disorders in the elderly [33, 34]. Many factors could account for this excess risk of anxiety and depression in the elderly during the pandemic. The risk of death or hospitalization following COVID-19 was greater in the elderly even after vaccines and antiviral drugs became available, since breakthrough infections and incomplete treatment responses were more common. Thus, fear may have persisted in older patients. Older adults also may have been disproportionately affected by social distancing guidelines, leading to increased social isolation, inadequate care at long-term care facilities, and loss of home care [35,36,37] Additionally, there were undoubtedly greater disruptions in social networks of older individuals as peers and loved ones passed away. All these considerations might contribute to the increased risk for anxiety and depression among older adults. The elderly may also have had more severe COVID-19 infections and/or had more underlying medical conditions that produced contact with the health care system, presenting greater opportunity for mental health issues to be diagnosed and treated. While this has been largely accounted for by matching for medical risk factors for severe COVID-19 disease and critical care services as well as conducting sensitivity analyses on hospitalized patients, it is still possible that this bias accounts for a portion of our results.

Our results stratified by sex support reports of higher depressive and anxiety disorders in females [38, 39]. Women traditionally assume an excess of the caregiving burden, which increased during the pandemic as schools closed and home help was unavailable. Especially early in the pandemic, job and financial security were reduced, and domestic violence increased during lockdown. Moreover, men may be more reluctant to seek help [40]. Our study found no consistent difference in risk after COVID-19 or other RTI when stratified by race; a slight but significant reduction in hazard was evident when comparing Black patients to White patients, although previous studies indicated that racial minorities experienced greater declines in mental health during the pandemic due to factors such as decreased access to mental health services, higher rates of job loss, and collective trauma from instances of violence in communities of color [41,42,43]. It is possible that mental distress among communities of color did not lead to physician contact to the same extent that as in white communities, resulting in fewer diagnoses in the electronic health record [43].

Limitations of our study include our inability to determine causality due to its retrospective, observational design. In addition, despite the very large number of electronic records included in the study, sample sizes were too small to properly evaluate racial and intersectional subgroups that might be predicted to have special vulnerability, such as women of childbearing age or women of color. Our study does not cover patients who did not have contact with the health care system, nor is the population necessarily representative of the entire US population. Moreover, EHR data may not have captured all COVID-19 infections, especially later in the pandemic as home testing became more prevalent, and vaccination status is likely underreported in the TriNetX Analytics Platform as vaccine availability expanded outside of the health systems. These potential omissions may have impacted propensity score matching and precluded testing the impact of vaccination on mental health outcomes. It is important to recognize that recurrence of depressive or anxiety disorders, especially if prior episodes were remote, is difficult to assess in the electronic health record but could represent an important risk factor for new episodes. In fact, when both new and recurrent prescriptions for antidepressants and anxiolytics were analyzed, the number of patients doubled compared to first-time prescriptions. Other than recurrent major depressive disorder (F33), we did not measure the association between COVID-19 and individual ICD-10 codes within the depressive and anxiety disorder subgroups. However, we did attempt to capture exacerbations of depressive and anxiety disorders by assessing prescriptions among patients who had not had prescriptions for these medications during the previous year. Anxiolytic drugs may have been prescribed for problems other than anxiety, such as sleep aids, and antidepressants may have been prescribed for indications other than depression, such as adjunctive pain therapy. However, the consistency of findings using the ICD-10 diagnostic categories and the pharmacologic interventions used most to treat them suggest that they are largely concordant measures for similar medical issues. Finally, although other RTIs and bone fractures were chosen as control health events to compare with COVID-19 infection, these diagnoses are not necessarily free of psychiatric risk. Both could also be linked to psychiatric sequelae through physiologic mechanisms, such as causing systemic inflammation that impacts the brain, or psychological mechanisms, such as limiting mobility and quality of life.

Overall, our findings, derived from a very large population, suggest that while a COVID-19 diagnosis was associated with elevated risk of depressive and anxiety disorders compared to control health events at the start of the pandemic, this risk decreased or was only mildly elevated after the first three months of the pandemic. It is likely that these temporal trends can be largely explained by the social context of the pandemic rather than, or in addition to, pathophysiologic mechanisms. Moreover, in our population, elderly patients were at particular risk throughout the duration of the pandemic. Recent USPSTF guidelines recommend screening for adults over 65 years old, but with only a “B” level of evidence for depression and insufficient evidence for anxiety [44, 45]. Our results indicate that more work is needed to improve the utility of screening instruments for older patients, especially since major public health challenges, ongoing, renewed, or new, are likely to continue. Additional research that captures patients without regular contact with the health system and patients from other racial and ethnic populations and in special communities such as the LGBTQ+ community is necessary to better understand the association between COVID-19 infection and mental health disorders and to identify those that may require continued screening.