## Main

The rapid spread of the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) virus across the globe resulted in many national and local governments implementing drastic health measures, including isolation, quarantine, lockdowns, physical distancing, closure of nonessential services and travel restrictions, to contain the spread of the virus3. The first complete lockdown began in most Canadian provinces in mid-March 2020 and continued until June 2020, with large numbers of people across the country urged to stay at home for substantial periods of time. The direct risks of the virus, uncertainty about disease status and the socioeconomic consequences of the enacted public health measures can have a substantial, long-lasting impact on individuals’ mental health and well-being, especially for older adults who are disproportionately affected by COVID-19, and the pandemic mitigation measures4.

Studies comparing mental health outcomes before the pandemic with results obtained during the early weeks of the pandemic have shown an increase in clinically significant levels of psychological distress5,6. Evidence from previous outbreaks, including the severe acute respiratory syndrome (SARS) and Ebola outbreaks, and the current COVID-19 pandemic indicates that many individuals have experienced a wide range of adversities, including challenges with meeting basic needs, increased caregiving responsibilities, difficulties with accessing non-COVID-19-related healthcare, employment and financial loss, and disruption of social networks, which may increase the risk of mental illness during and after the outbreaks7,8,9. Further, the impact of the COVID-19 pandemic on the older population has occurred against the backdrop of existing physical and mental health morbidities, social isolation, loneliness and reliance of aging individuals on both family and formal caregivers—factors that are themselves associated with increased risk, severity and progression of mental illness10. These findings highlight the importance of identifying subgroups of individuals who are most at risk of poor mental health and examining how their mental health is changing as the pandemic continues.

Most studies examining the mental health impact of the COVID-19 pandemic have been conducted in younger samples, have included specific target populations and have been cross-sectional in design. Some longitudinal studies have focused on average change in depressive symptoms for the entire sample or lacked depression measures before the pandemic, which makes it challenging to examine changes in mental health and can obscure different patterns of change in mental health over time. Although many studies have reported worse mental health outcomes during the early weeks of the pandemic, some sources suggest a gradual decrease in anxiety and depressive symptoms during lockdown2. Some evidence also suggests that older individuals did not experience poorer psychological well-being than comparatively younger individuals11. However, social participation and loneliness were identified as important risk factors for psychological well-being, and it is these factors that have been impacted during the pandemic, especially for older adults. Therefore, it remains to be explained whether mental health continued to deteriorate during the initial lockdown (March–December 2020) or whether there were signs of stabilization or improvement in the mental health of community-dwelling middle-aged and older adults. Further, it remains to be clarified whether the risk factors had a differential effect on the psychological well-being of older adults compared with middle-aged adults or whether the impact was consistent across the adult lifespan. The purpose of this study was to examine the relationship of social determinants and health-related factors with changes in the prevalence of depressive symptoms during the initial lockdown and after reopening following the first wave in Canada and to evaluate the impact of loneliness and pandemic-related stressors on the severity and trajectory of depressive symptoms in middle-aged and older adults.

## Results

### Statistical analysis

Descriptive statistics were reported at each time point. CLSA first follow-up data were used to impute a whole variable that was not assessed in the COVID-19 baseline and exit surveys, and COVID-19 baseline data were used to impute a variable that was not assessed in the COVID-19 exit survey. The WGEE was used to examine the change in prevalence of depressive symptoms over time. The WGEE can model longitudinal or clustered data and binary outcomes and can handle monotonic missing data appropriately when the data are missing at random36. We performed WGEE on 37,111 individuals, which includes those with a monotonic pattern of missing data for the depressive symptom variable. Interaction terms between time period and sociodemographic and health factors were assessed to determine how the change in depressive symptom prevalence over time depended on these factors. For each risk factor by time period interaction, ORs were reported for at-risk groups during the COVID-19 baseline and exit time points in comparison with the group that was least at risk before the pandemic. The WGEE models were adjusted for all the covariates listed above. Age was included as a time-varying covariate, loneliness was assessed at CLSA first follow-up and all other covariates were assessed at CLSA baseline.

LCGM, a semiparametric, group-based modeling strategy, was used to identify distinct classes of individuals who follow a similar pattern of depressive symptoms over the four time points and to examine the impact of loneliness and COVID-19 experiences on the depressive symptoms trajectories37. The censored normal distribution was specified as the depressive symptoms score was modeled as a continuous variable to more accurately model data where floor and ceiling effects may be possible. Model selection involved testing different numbers and shapes of trajectory groups using statistical considerations and model parsimony. The best fitting model was identified by comparing the Akaike’s information criterion (AIC) and Bayesian information criterion (BIC) values, with smaller values indicating a good fitting model. Quadratic and cubic terms that were not statistically significant were excluded from the model. Trajectories were modeled using the PROC TRAJ procedures in SAS37. Missing longitudinal data were handled in the PROC TRAJ procedure under the missing-at-random assumption, which permits patterns with missing data to borrow parameter information from patterns with more or complete data points through the latent variable38. In addition to the covariates listed above, the LCGM was adjusted for self-reported COVID-19 status based on the criteria adapted from the Public Health Agency of Canada and Centers for Disease Control and Prevention that were available during the initial wave of the pandemic39,40. Confirmed cases of COVID-19 included participants who reported testing positive for SARS-CoV-2 by nucleic acid amplification test. Probable cases of COVID-19 included (1) participants who had a laboratory test with fever (over 38 °C) or new onset or exacerbation of cough or who met the COVID-19 exposure criteria and were tested for COVID-19, but the results were inconclusive; or (2) participants who did not have a laboratory test but reported fever (over 38 °C) or a new onset or exacerbation of cough and had close contact with a confirmed COVID-19 case or lived or worked in a closed facility known to be experiencing an outbreak of COVID-19; (3) participants who were told by a healthcare provider that they had COVID-19 but did not have a confirmatory test. Suspected cases of COVID-19 included participants who reported two or more symptoms including fever, cough (dry or wet), runny nose, sore/scratchy throat, headache, chills or shivering, muscle and/or joint aches/pains, loss of smell or difficulty breathing and met the exposure criteria or had a close contact with a probable case of COVID-19. OR and 95% CI values were reported, statistical significance was set at 0.05 for a two-tailed test and statistical analysis was conducted using SAS software v.9.4. CLSA has developed a core suite of software based on open-source code to collect data. The specific software used to collect data include ONYX (v.1.12.0), Limesurvey (v.3.7.1 with customizations) and PINE (v.2.7).

### Reporting Summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.