Introduction

Type 2 diabetes (T2D) is the most common chronic metabolic disease in the USA, with a prevalence of 10.5% in 2020 [1]. Optimal glycemic management—as measured by glycosylated hemoglobin level (HbA1C)—remains the recommended strategy to prevent and reduce long-term diabetes complications [2]. To achieve optimal glycemic level, improve quality of life, and prevent premature death, the American Diabetes Association recommends practicing substantial lifestyle changes and prescribing individually tolerated diabetes medications with the goal of reducing the risk of developing diabetes-related cardiovascular, neurological, psychological, and other complications [3]. Thus, medication taking is a crucial component in diabetes care management, with research showing a significant association between irregular medication taking and increased risk of diabetes-related complications, hospitalization, and mortality [4].

Epidemiological data shows that the prevalence of depression is about two times higher among people with diabetes than those without diabetes [5]. The link between depression and diabetes may reflect many factors, including the psychological burden of living with a chronic disorder and high rates of cerebrovascular disease–related vascular depression [6,7,8]. Co-occurrence of diabetes and depression has a detrimental impact on health outcomes, with research showing an increased risk of diabetes-related microvascular complications (e.g., nephropathy, retinopathy, neuropathy) and macrovascular complications (e.g., stroke, coronary artery disease, and peripheral artery disease) [9]. The association of depression with microvascular complications was slightly stronger than that with macrovascular complications among patients with an average diabetes duration of 8.8 years [10]. However, in newly diagnosed T2D patients, the association of depression with macrovascular complications was stronger [11]. The co-occurrence of depression in patients with T2D raises the risk of complications and mortality via multiple pathways, including the potential impact of depressive symptoms on the change of diet, exercise, and medication taking, with a possible effect on worsening of glycemic management and acceleration of atherosclerotic cardiovascular/cerebrovascular diseases [9, 12].

Insulin resistance, increased inflammation, and endothelial cell dysfunction among patients with diabetes contribute to the increased risk of depression [13,14,15,16]. The bidirectional relationship between diabetes and depression has been well documented [16, 17]. However, the evidence on the relationship between the quality of diabetes management and the onset of depression is limited. There is also a knowledge gap with regard to the complex relationships between diabetes complications, antihyperglycemic medication taking, and incidence of depression. To address the aforementioned research gaps, our study aims are twofold: (1) to explore the long-term trends of diabetes medication taking in the population with T2D and regular care and (2) to examine the rates and predictors of incident depression, with a focus on the role of diabetes medication taking and assess whether the association varies by presence and type of diabetes complications. It is essential to look at long-term trends in diabetes medication taking, given the myriads of new medications (with varying ease of use, cost, and side effect profile) that were approved between 2010 and 2018. Examining the association of diabetes medication taking with the onset of depression and the potential role of diabetes complications on this association can provide data to improve diabetes care guidelines and inform health policy aimed at improving the quality of life of the growing number of Americans living with diabetes and its physical, psychological, social, and cognitive sequela.

Materials and Methods

Study Design, Setting, and Participants

This retrospective cohort study used a 100% Texas Medicare claim database from 2008 to 2018 and followed the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) guideline [18]. A cohort of Texas Medicare beneficiaries continuously enrolled for 3 years (2008–2010) in fee-for-service (FFS) and aged ≥ 66 years in 2010 were selected (Supplementary Fig. S1). We restricted our cohort to beneficiaries with at least four claims with any diabetes diagnosis in 2010 to represent a population with diabetes and regular care. Furthermore, we excluded the beneficiaries with type I diabetes (T1D) or depression diagnosis during 2008–2010. The final cohort included 72,461 beneficiaries with depression-free T2D.

The Master Beneficiary Summary File (MBSF) base segment was used to determine Medicare enrollment status, demographics (age, sex, and resident area), and mortality. International Classification of Diseases (ICD) diagnosis code (Supplementary Table S1) from Outpatient Statistical Analysis Files (OutSAFs), Carrier files, and Medicare Provider Analysis and Review (MedPAR) files were combined to determine diabetes, depression, diabetic complications, and other medical conditions. Prescription Drug Event (PDE) files were used to identify diabetes medication use. The algorithms for identifying clinical conditions from claims data has been validated in past studies [19, 20], and the prescription records in the Medicare claim database was reported as high quality [21]. The University of Texas Medical Branch Institutional Review Board (IRB) deemed this study (IRB No. 21–0024) as exempt from IRB review.

Primary Variables and Covariates

Our primary outcome was incident depression, and the main predictor was medication taking. Six categories of diabetes complications (the microvascular complications of retinopathy, nephropathy, and neuropathy; and the macrovascular complications of cerebrovascular (e.g., stroke), cardiovascular (e.g., coronary artery disease), and peripheral vascular disease) were evaluated for a potential moderating or mediating effect in separate models for each individual complication and for overall complication. Medicare claims files for 2010–2018 were used to measure incident depression, medication taking, and diabetes complications. Medication taking was measured by the prescription refill date and the days of supply in the prescription records; the proportion of days covered (PDC) was calculated and dichotomized into regular medication taking (PDC ≥ 0.8) and irregular medication taking (PDC < 0.8). A PDC of 0.8 or above is a common measure of medication taking and a reasonable cut-off to predict adverse outcomes [22, 23]. National Drug Code (NDC) codes were used to identify antihyperglycemic drug use according to therapeutic class in the IBM Micromedex RED BOOK (Supplementary Table S2). Yearly PDC was measured by counting the number of days with prescriptions in a year, with the same day with multiple prescriptions counted as only one day. In addition to dichotomizing PDC into regular and irregular taking, we also categorized PDC into five levels (< 0.2, ≥ 0.2 < 0.4, ≥ 0.4 < 0.6, ≥ 0.6 < 0.8, and ≥ 0.8) to explore the dose–response effect.

Baseline characteristics were measured in 2010, including age, sex, race, original entitlement, residential area, comorbidity, hospitalization, emergency room (ER) admission, and physician visit. The residential area was classified into two-level rurality (metropolitan/urban and rural) according to 2013 rural–urban continuum codes from the US Department of Agriculture [24], and number of comorbidities was determined by the Elixhauser Comorbidity Score [20]. We defined hospitalization as an acute hospital or critical access hospital stay from the MedPAR file. ER admissions were identified by ER revenue codes (0450, 0451, 0452, 0456, 0459, 0981) in OutSAFs and an ER charge amount greater than zero dollars in the MedPAR file. The number of unique claims on the same date from the same provider was used to define the number of physician visits from the OutSAFs and Carrier files using Current Procedural Terminology (CPT) codes (99201–99205, 99211–99215).

Statistical Analyses

The distribution of baseline characteristics was summarized as count and percentage for each category and the chi-square test was applied for group comparison. We used multivariable Cox proportional hazards regressions to estimate the impact of medication taking on depression, with adjustment for baseline characteristics and diabetes complications; censored events included death, discontinuation of FFS enrollment, and the end of the study (December 31, 2018). Cumulative sums of martingale-based residuals [25] were applied to evaluate the proportional hazards assumption for the main predictor in the Cox models and no significant proportional hazards violation was reported. An interaction term of medication taking and diabetes complication was included in Cox models to test the modification effect. The Valeri and VanderWeele SAS macro %mediation [26] was applied to estimate the causal mediation effects, based on the logistic mediator model and the Cox outcome model without the interaction between medication taking and diabetes complications. Furthermore, we built two more models for sensitivity analyses. First, Fine-Gray models included death as a competing risk. Second, medication taking and diabetes complications were treated as time-varied predictors in multivariable Cox models. We identified medication taking in 2010, and then over each 12-month period every six months throughout the follow-up period (e.g., January 2010–December 2010, July 2010–June 2011, January 2011–December 2011, July 2011–June 2012) as a time-dependent covariate. Diabetes complications were evaluated during the follow-up period. The status of complication was to be defined as “no” before the first diagnosis of a complication, then changed to “yes” from the first diagnosis to the end of follow-up. In the time-dependent model, discontinuation of Medicare part D coverage was added as a censoring event. All analyses were performed with SAS version 9.4 (SAS Inc., Cary, NC).

Results

Participants

We identified 72,461 patients with T2D and regular care and 12,245 (16.9%) patients without medication treatment at baseline (Table 1). Mean ages were 76.3 (6.5) years in the treatment group and 78.1 (7.2) years in the no-treatment group. There was no association between sex and medication taking status. There were more Hispanics in the irregular medication taking group, while more Whites were in the no-treatment group. The most common complication was cardiovascular disease (CVD) (41.9%), and then the less common complications were retinopathy (6.8%) and cerebrovascular disease (7.3%). Compared to the irregular medication taking group, the regular medication taking group had a lower rate of cardiovascular disease (39.6% vs. 43.1%) and cerebrovascular complications (6.1% vs. 8.0%) but a higher rate of retinopathy (7.8% vs. 6.6%).

Table 1 Baseline characteristics

Medication Taking

We restricted our study to 60,216 patients with diabetes treatment in 2010 for medication taking analyses. At the beginning of the follow-up, 60.8% of treated patients showed regular medication taking. Using 6 months as an interval to repeatedly measure yearly medication taking, the proportion of patients with regular medication taking slightly increased, from 60.8 to 63.2% (Fig. 1A). An alluvial diagram in Fig. 1B showed the medication taking trajectory from 2010 to 2018. Among 9951 patients with regular medication taking at the end of the study, 72% had regular taking at baseline and 39.5% maintained regular taking during the entire study period.

Fig. 1
figure 1

Medication taking from 2010 to 2018. A Yearly regular medication taking rate for different measurement periods. B Alluvial diagram of medication taking

Main Effect, Modification, and Mediation Effect

We analyzed 60,216 patients with treatment to explore the time to develop depression (Fig. 2) and the impact on depression of medication taking and baseline characteristics (Supplementary Table S3). With adjustment for baseline characteristics, patients with regular medication taking had a 9% lower risk of developing depression (hazard ratio [HR]: 0.91, 95% confidence interval [CI]: 0.89–0.94). The trend of association of regular medication taking with lower risk was observed along five levels of medication taking (Table 2). The association of regular medication taking with developing depression was slightly weak in the competing risk model (HR: 0.94, 95% CI: 0.91–0.98), but it was stronger when regular medication taking was measured as a time-dependent covariate (HR: 0.82, 95% CI: 0.79–0.85).

Fig. 2
figure 2

Kaplan–Meier estimate on time to develop incident depression from 2010 to 2018 stratified by baseline proportion of days covered (PDC) of antihyperglycemic medication (N = 72,461). A Two levels of PDC (green, PDC ≥ 0.8; yellow, PDC < 0.8; gray, no treatment). B Five levels of PDC (green, PDC ≥ 0.8; red, 0.6 ≤ PDC < 0.8; blue, 0.4 ≤ PDC < 0.6; purple, 0.2 ≤ PDC < 0.4; yellow, PDC < 0.2; gray, no treatment)

Table 2 Adjusted hazard ratio of the effect of diabetes medication taking on incident depression (N = 60,208)*a

Modification and mediation effects were explored for overall and individual complications (Table 3). Nephropathy was found to have a significant interaction effect on the relationship of medication taking and depression. Stratification analysis revealed that the impact of medication taking on depression was more substantial for patients with nephropathy than those without nephropathy (Supplementary Table S4). Overall, complications had about a 20% mediation effect. For individual diabetes complications, nephropathy had the greatest mediation effect (23.2%) and cerebrovascular disease had the smallest (2.3%).

Table 3 Modification and mediation effect of diabetic complication on the association between regular diabetes medication taking and depression development

Discussion

Our study demonstrated that, among Medicare beneficiaries with T2D, regular medication taking at baseline was associated with long-term regular medication taking and with a lower risk of incident depression. The medication taking-depression association was stronger for patients with nephropathy complications than for those without nephropathy complications. An unexpected finding was that nephropathy complications significantly mediated the medication taking-depression association.

Past studies showed that regular diabetes medication taking (adherence) rates vary from 36 to 93%, depending on the populations studied and the data collection methods used [27]. Our study reported a rate of around 60%, which was slightly lower than the rate of 70% reported among the general adult population [28] but higher than the 40% rate reported in the Medicare advantage population [29]. The difference could be the result of varying sociodemographic factors and the study population enrollment criteria. Patients perceived to be healthy (younger, female, and the newly diagnosed) and the complexity of medication regimen have also been reported to be associated with irregular medication taking (poor adherence) [28, 30]. Otherwise, medication taking trajectory studies—such as our study—reported that regular medication taking in the context of consistent and regular diabetes care was associated with a lower risk of hospitalization, ER visits, and diabetes complications [31, 32]. Our study revealed that those patients with regular medication taking (versus irregular taking) at baseline tended to maintain steady regular taking over time, but the irregular taking group showed inconsistent medication taking. Regular medication taking early in the disease course may confer long-term benefits, including steady regular taking as well as other non-drug lifestyle changes (e.g., diet, exercise), resulting in improvement in disease outcome.

Previous cross-sectional studies showed an association between depression and an increased odds of irregular diabetes medication taking [33]. Limited longitudinal studies reported the association in the other direction. Our study thus demonstrated that irregular diabetes medication taking by itself could result in higher odds of new-onset depression. The underlying mechanisms of depression in diabetes can be divided into behavioral and biological [6]. The hypothesis of the biological mechanism of the link between diabetes and depression proposes that immune activation and vascular changes (e.g., strokes) could precipitate depressive and cognitive symptoms [15, 34]. Medication taking and glycemic management are strongly associated, with hyperglycemia being additionally related to immune dysfunction [35] and vascular damage [36]. Furthermore, regular medication taking in the early stage of diabetes has been proposed to be a critical component in achieving long-term optimal pharmacotherapy effectiveness [37]. We found an effect of regular medication taking on the development of depression using both baseline and time-varied approaches.

The medication taking-depression association in our study was also consistent with the results from past studies of shared risk factors (e.g., elevated inflammatory markers) in patients with CVD, kidney disease, and depression [38,39,40]. Similar to other chronic illnesses, the underlying mechanisms of depression in CVD and kidney disease included behavioral, environmental, and biological factors. Our finding on the modifying effect on the medication taking-depression association was supported by the previous finding of an association of diabetic nephropathy stage with depression severity [41]. In the pathway between T2D and depression, past research showed that, over the long term, new-onset of depressive episodes was reported as a second new diagnosis after T2D onset, with the first new diagnosis being kidney disease or retinal disorders [42]. Furthermore, a previous study demonstrated that inconsistent diabetes medication use increased the risk of kidney problems [43]. Our mediation analysis also found a connection between medication taking and depression through complications; others have reported a more vital pathway through microvascular complication than macrovascular complication, especially for kidney disease, a finding consistent with microvascular ischemic changes in the brain as a potential contributor to vascular depression [7, 8].

To our knowledge, this is the first study to estimate the impact of medication taking on incident depression with a large sample of older patients with T2D while accounting for time-varied medication taking. Another strength of our study is that it explored the potential practice-actionable mediators in the path between medication taking and depression, with the inclusion of diabetes microvascular and macrovascular complication as time-varied predictors in time-dependent models. Our study should be interpreted with the following limitations. First, a mediation effect of nephropathy complications on incident depression was reported in this study, but a previous study reported that depression increased the risk of incident microvascular and macrovascular complications [17]. The bidirectional association between diabetes complications and depression could reflect the timeline of screening and claims documentation, such that those with regular guideline-recommended renal function checks (annual urine microalbumin checks) could also be the patients with a high likelihood of regular medication taking. This is an area for future study. In our study, the identification of incident depression relied on diagnosis code in the claim data, and the time to develop depression may simply have been a reflection of a delay in screening for and detection of depressive disorders. It is possible that patients with undiagnosed depressive symptoms but without regular healthcare service involvement were misclassified as depression-free. Second, PDE files do not include information on whether a patient took the medication prescribed or on medications without Medicare part D coverage. We used prescription refill claims to define regular medication taking without accounting for the behaviors of taking medicines in different dosing schedules or of medications refilled by out-of-pocket or private insurance. Third, our study included Texas Medicare FFS beneficiaries with T2D diagnosis and with regular care. The results for patients living outside of Texas, those without regular care, or those with different insurance plans may be different. Fourth, we included only diabetes medication taking and diabetes complication as time-varied predictors in our time-dependent models. Comorbidity and healthcare utilization status could be considered time-varied predictors, but we aimed to focus on the pathway from medication taking to depression through complications and simplified other confounding factors to prevent over-adjustment. Thus, baseline comorbidity and healthcare utilization status were analyzed as time-independent predictors. More comprehensive inclusion of all comorbidities, diabetes complications, and healthcare use variables as potential mediators/moderators and confounding factors in the medication taking-depression association is an area of further study that could identify any time change effects resulting from the confounding factors. Finally, claims data do not have information on the glycemic level. Discontinuation of pharmacotherapy during the observation period leads to lower PDC and was defined as irregular medication taking. However, treatment discontinuation could result from achieving the goal of glycemic level; such patients would have been classified as irregular medication taking. Thus, the impact of irregular taking on depression may be underestimated.

Despite some limitations, this study extends the knowledge about the long-term medication taking trajectory in patients with T2D and the trends and their impacts on the development of depression. We demonstrated steady regular medication taking over time through long-term follow-up on medication taking and a significant rise in incident depression in patients with irregular medication taking. The magnitude of the association between medication taking and depression was more substantial for patients with nephropathy than those without it. Nephropathy also showed a strong but modest mediating effect on the medication taking-depression association. Our findings suggest that monitoring medication taking schedule and routine screening for depression should be included as part of standard diabetes care at diagnosis, with the goal of implementing patient-centered interventions to improve regular medication taking and preserve good mental health throughout the disease course.