SGLT2 inhibitors, GLP-1 RAs, and DPP4 inhibitors and the risk of hypomagnesemia in type 2 diabetes: A target trial emulation
Shih-Chieh Shao, Daniel Hsiang-Te Tsai, Albert Tzu-Ming Chuang, Kuan-Hung Liu, Edward Chia-Cheng Lai

TL;DR
This study finds that SGLT2 inhibitors and GLP-1 RAs may reduce the risk of low magnesium levels in type 2 diabetes patients compared to DPP4 inhibitors.
Contribution
The study provides real-world evidence of class-level effects of SGLT2 inhibitors and GLP-1 RAs in reducing hypomagnesemia risk in type 2 diabetes.
Findings
SGLT2 inhibitors were associated with a 20% lower risk of hypomagnesemia compared to DPP4 inhibitors.
GLP-1 RAs also showed a 11% lower risk of hypomagnesemia compared to DPP4 inhibitors.
SGLT2 inhibitors had a 8% lower risk of hypomagnesemia compared to GLP-1 RAs.
Abstract
Recent studies have suggested potential effects on magnesium homeostasis associated with sodium-glucose cotransporter 2 (SGLT2) inhibitors and glucagon-like peptide-1 receptor agonists (GLP-1 RA). We sought to determine whether these effects lead to a reduced risk of hypomagnesemia among adults with type 2 diabetes in clinical practice. We conducted a target trial emulation study using the multi-institutional cohort data from the TriNetX Global Collaborative Network. We compared 1:1 propensity score-matched patients with type 2 diabetes newly initiating SGLT2 inhibitors versus dipeptidyl peptidase-4 (DPP4) inhibitors (n = 718,798), GLP-1 RAs versus DPP4 inhibitors (n = 623,390), and SGLT2 inhibitors versus GLP-1 RAs (n = 702,808) from 2016 to 2024. Propensity scores were estimated using logistic regression models that included baseline covariates such as age, sex, race, comorbidities,…
Genes, proteins, chemicals, diseases, species, mutations and cell lines named across the full text — each resolved to its canonical identifier and authoritative record.
Click any figure to enlarge with its caption.
Fig 1
Fig 2
Fig 3
Fig 4- —National Science and Technology Council of Taiwan
- —National Science and Technology Council of Taiwan
- —National Science and Technology Council of Taiwan
- —National Health Research Institutes of Taiwan
- —http://dx.doi.org/10.13039/501100007750National Cheng Kung University
- —http://dx.doi.org/10.13039/501100007750National Cheng Kung University
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMagnesium in Health and Disease · Parathyroid Disorders and Treatments · Diabetes Treatment and Management
Introduction
Hypomagnesemia, defined as serum magnesium levels below 1.8 mg/dL (0.75 mmol/L), is a common condition in patients with type 2 diabetes, affecting up to 25% of this population—about 10 times more frequently than in the general population [1,2]. This condition is clinically significant, as it is associated with aggravated diabetes progression and a higher risk of systemic complications, such as arrhythmia, which can significantly impact patient health and quality of life. Therefore, strategies to reduce the risk of hypomagnesemia in this group of patients are critically needed.
Sodium-glucose cotransporter 2 (SGLT2) inhibitors have become an integral part of type 2 diabetes management due to their benefits beyond glucose control, including improvements in cardiorenal function and metabolic outcomes [3–11]. Recent research has suggested that SGLT2 inhibition may influence a variety of local and systemic factors, both hormonal and nonhormonal, that could play a role in maintaining magnesium homeostasis [12]. A meta-analysis of 25 randomized trials, including 23 placebo-controlled trials, with a median follow-up of 58.7 weeks, showed that SGLT2 inhibitors increased serum magnesium by a weighted mean difference of 0.07 mmol/L (95% CI: 0.06–0.08), compared with placebo [13]. However, it is unknown whether this increase in magnesium levels observed from clinical trials also leads to a reduced risk of hypomagnesemia in clinical settings. Moreover, most included trials have excluded patients with chronic kidney disease (CKD), thereby limiting generalizability to patients without CKD. Additionally, preliminary evidence suggests that glucagon-like peptide-1 receptor agonists (GLP-1 RAs) reduce urinary magnesium excretion and potentially preserve serum magnesium levels in individuals with type 2 diabetes [14], but large-scale epidemiological data are also lacking. Therefore, further studies on the risks of hypomagnesemia are warranted, especially focusing on active comparisons of different anti-diabetic drug classes pertinent to current practice in a broad range of patients with type 2 diabetes. This study aimed to evaluate the comparative effectiveness of SGLT2 inhibitors, GLP-1 RAs, and dipeptidyl peptidase-4 (DPP4) inhibitors in lowering the risk of hypomagnesemia among patients with type 2 diabetes.
Methods
Data source
In this study, we used the TriNetX Global Collaborative Network, a large-scale federated database containing anonymized electronic health records from over 153.5 million patients across more than 128 healthcare organizations (HCOs) in 21 countries, spanning the Americas, Europe, the Middle East, Africa, and the Asia-Pacific region, based on data statistics as of September 2024. HCOs are typically healthcare systems based in academic medical centers or research-oriented nonacademic institutions that agree to share de-identified patient data for research purposes. This platform includes data on patients’ demographics, diagnoses [encoded as International Classification of Diseases, Tenth Revision, Clinical Modification (ICD-10-CM) codes], medications, and procedures. Diagnosis, procedure, and laboratory codes generated by participating HCOs in this network have demonstrated high data quality and completeness. Recent studies have also demonstrated its critical role as an essential data resource for generating real-world evidence for clinical care [15,16]. This study followed the Transparent Reporting of Observational Studies Emulating a Target Trial (TARGET) reporting guidelines (S1 Table) [17,18].
Specification of the target trial
We designed this observational study to emulate a target trial, defined as a hypothetical pragmatic trial that would directly evaluate the risk of hypomagnesemia among patients with type 2 diabetes initiating SGLT2 inhibitors, DPP4 inhibitors, or GLP-1 RAs. The study outcome of hypomagnesemia was defined as a hypomagnesemia diagnosis (ICD-10-CM: E83.42) or serum magnesium levels less than 1.80 mg/dL [19]. The key components of the target trial are presented in S2 Table.
Emulation of the target trial
Using multicenter electronic health records from the TriNetX platform, we conducted a target trial emulation study to improve the quality of an observational study investigating the effects of interventions [20,21]. The target trial emulation framework involves designing and analyzing an observational study to replicate the structure and objectives of a hypothetical pragmatic trial addressing the same research question [22,23]. We identified three cohorts of patients who initiated either SGLT2 inhibitors or DPP4 inhibitors (Cohort 1), either GLP-1 RAs or DPP4 inhibitors (Cohort 2), and either SGLT2 inhibitors or GLP-1 RAs (Cohort 3), from 2016 to 2024. Cohort entry (i.e., the index date) was the date of newly receiving a prescription for SGLT2 inhibitors, GLP-1 RAs, or DPP4 inhibitors. DPP4 inhibitors were selected as the comparator due to their widespread use as second- or third-line therapeutic options in the management of type 2 diabetes, similar to SGLT2 inhibitors or GLP-1 RAs. The DPP4 inhibitor group was selected as the comparator to help mitigate potential confounding biases, including those related to treatment indication and variations in disease severity among patients with type 2 diabetes [24–26]. In each cohort, the two treatment groups were independent and mutually exclusive at baseline, meaning that patients had no prior exposure to the drugs of the comparator group before the index date. We restricted the study cohorts to adult patients (aged 18 years or above) with a diagnosis of type 2 diabetes. We excluded patients who had a history of type 1 diabetes or gestational diabetes, alcohol-related disorders, cirrhosis or acute hepatitis, acute or chronic pancreatitis, neoplasms, cachexia, Crohn’s disease, celiac disease, ulcerative colitis, renal tubulopathies, Bartter’s syndrome, intestinal malabsorption, transplanted organ status, gastric bypass surgery or estimated glomerular filtration rate (eGFR) <30 ml/min/1.73m^2^. To ensure incident outcomes, we further excluded patients with a hypomagnesemia diagnosis in the inpatient or outpatient setting before cohort entry. The study design diagram is presented in S1 Fig [27].
We estimated propensity scores using logistic regression models that included the baseline covariates [e.g., age, sex, race, comorbidities (including diabetes complications, cardiovascular diseases, thyroid diseases, liver diseases, CKD, and fluid-related diseases), medications (including anti-diabetes medications, cardiovascular medications, and other drugs potentially affecting serum magnesium hemostasis), and laboratory data (including hemoglobin A1c, eGFR, body mass index and proteinuria)], as listed in Table 1. The disease diagnoses and drug codes used for this study are presented in S3–S6 Tables. To emulate the randomization of the target trial and ensure that the three study cohorts had similar probabilities of treatment assignment, we implemented 1:1 propensity score matching without replacement for each drug comparison (SGLT2 inhibitors versus DPP4 inhibitors, GLP-1 RAs versus DPP4 inhibitors, and SGLT2 inhibitors versus GLP-1 RAs) separately. Matching was performed using a greedy nearest-neighbor algorithm with a caliper width of 0.1 of the standard deviation of the logit of the propensity score to create study cohorts with comparable baseline characteristics [28,29].
Table 1: Baseline characteristics of patients with type 2 diabetes initiating SGLT2 inhibitors vs. DPP4 inhibitors, GLP-1 RAs vs. DPP4 inhibitors, and SGLT2 inhibitors vs. GLP-1 RAs, after 1:1 propensity score matching.
For missing baseline laboratory data, a “no measurement” category was assigned to account for potential unmeasured factors contributing to the absence of these results, and to ensure that such patients were retained in the matching process [20,21]. The balance of baseline characteristics was assessed using absolute standardized mean differences (ASMDs), with ASMD less than 0.1 indicating a sufficient balance [28,30].
Statistical analysis
The comparative risks of hypomagnesemia for SGLT2 inhibitors versus DPP4 inhibitors, GLP-1 RAs versus DPP4 inhibitors, and SGLT2 inhibitors versus GLP-1 RAs were evaluated using Cox proportional hazards regression under a fixed-effects model. We estimated hazard ratios (HRs) with 95% confidence intervals (CIs), and also reported absolute risk differences with corresponding 95% CIs. We followed up each eligible patient from the index date until the occurrence of an outcome (e.g., hypomagnesemia), loss to follow-up, death, or the end of the database (e.g., March 31, 2025), whichever occurred first, based on intention-to-treat principles. We used Kaplan–Meier curves to estimate time-to-event probabilities. The statistical codes for propensity score matching and Cox proportional hazard model analysis are presented in S7 Table. Furthermore, we conducted several subgroup analyses according to age group (<60 or ≥60 years), sex (male or female), HbA1c level (<7 or ≥7%), eGFR level (30–60 or ≥60 mL/min/1.73m^2^), CKD diagnosis (yes or no) and individual drug comparisons to examine the result consistency within different subgroups. To examine whether the findings were consistent among patients with albuminuria but with preserved kidney function, we also conducted subgroup analyses in patients with urinary albumin/creatinine ratio >30 mg/g and eGFR ≥ 60 mL/min/1.73 m². Finally, we estimated the HRs separately for distinct time intervals in the first, second, third, fourth, and fifth years of follow-up to examine the variation in HRs over time [31]. We considered a 2-sided P < 0.05 as statistically significant.
All statistical analyses in this study, including propensity score matching, Kaplan–Meier curves, and Cox proportional hazard analysis were performed using the built-in functions of the platform. The platform integrates Java 11.0.16 (with Apache Commons Math 3.6.1), R 4.0.2 (with Hmisc 1-1 and Survival 3.2-3), and Python 3.7 (with lifelines 0.22.4, matplotlib 3.5.1, numpy 1.21.5, pandas 1.3.5, scipy 1.7.3, and statsmodels 0.13.2). Specifically, Java 11.0.16 was used to prepare data for input into the statistical packages, mainly R 4.0.2 with Hmisc 1-1 and the Survival package (3.2-3), an open-source language for statistical computing [32]. The Survival 3.2-3 package includes core survival analysis routines, such as Kaplan–Meier and Aalen–Johansen (multi-state) curves, Cox models, and parametric accelerated failure time models. Outcomes were analyzed using the R Survival package (v3.2-3), and the results were validated through comparison with SAS version 9.4 [32]. Within R, the Hmisc 1-1 package was also used to generate summary tables. Propensity scores calculated by logistic regression were estimated in Python 3.7 with NumPy 1.21.5 [33]. Descriptive statistics were post-processed using data analysis packages (Pandas, NumPy) [34,35].
Individual drugs in the SGLT2 inhibitor and GLP-1 RA classes
To examine potential variations in the risk of hypomagnesemia among individual drugs within the SGLT2 inhibitor and GLP-1 RA classes, we established separate cohorts for canagliflozin, dapagliflozin, empagliflozin, ertugliflozin, albiglutide, dulaglutide, exenatide, liraglutide, lixisenatide, and semaglutide, and compared each with DPP4 inhibitors. Propensity scores were re-estimated, matching was repeated, and effect estimates for the primary outcome were recalculated accordingly.
Positive and negative control outcome analyses
To ensure the reliability of our findings, we evaluated the risks of incident hyperkalemia (ICD-10-CM: E87.5, or serum potassium ≥5.5 mmol/L) and appendicitis (ICD-10-CM: K35-37) as positive and negative control outcome analyses, respectively, to replicate known and null associations using the same study design [36].
Sensitivity analysis
To ensure the robustness of our results, we conducted several additional sensitivity analyses. First, we excluded patients with other disorders of fluid, electrolyte, and acid-base balance, since the presentation and other biochemical abnormalities of these conditions may overlap with those of hypomagnesemia. Second, we restricted our outcome definitions by using only serum magnesium levels <1.8 mg/dL. Third, we re-defined our study outcome based solely on the use of intravenous magnesium sulphate or magnesium chloride, which indicated cases of severe hypomagnesemia requiring treatment. Fourth, we excluded patients who had previously undergone serum magnesium testing. In routine clinical practice, serum magnesium measurement is not commonly performed in patients with type 2 diabetes, but it is typically ordered when physicians suspect specific comorbidities or electrolyte imbalances, which may indicate differences in clinical status or symptom severity. This analysis helped provide evidence of our result robustness by minimizing bias related to indication-based testing practices. Finally, we excluded patients who switched to or initiated another drug class during follow-up to assess the robustness of the findings.
Ethics approval
The data complies with the Health Insurance Portability and Accountability Act and the General Data Protection Regulation. Ethical approval is not required for studies conducted within the TriNetX network analysis platform because the federated system contains only de-identified data, presented as aggregated counts and statistical summaries. Nevertheless, the study protocol was approved by the Institutional Review Board of the Chang Gung Medical Foundation (Approval No. 202401883B0).
Results
Baseline characteristics of the study populations
After applying the study inclusion and exclusion criteria (Fig 1), we included 359,399 propensity score-matched pairs in the SGLT2 inhibitor versus DPP4 inhibitor cohort, 311,695 pairs in the GLP-1 RA versus DPP4 inhibitor cohort, and 351,404 matched pairs in the SGLT2 inhibitor versus GLP-1 RA cohort. All three cohorts showed similar distributions of baseline characteristics (e.g., demographics, comorbidities, medications, and relevant laboratory results) with all ASMDs less than 0.1 (Table 1). The propensity score distributions before and after matching are presented in S2 Fig.
Patient flowchart.Boxes with numbered statements denote the exclusion criteria.
In the SGLT2 inhibitor versus DPP4 inhibitor cohort, the mean age of the SGLT2 inhibitor group was 62.0 years, with 45.7% female, 50.2% White, and 7.3% having a history of CKD, all of which were comparable to the DPP4 inhibitor group. Among participants with available laboratory results, the mean HbA1c was 8.3% and the estimated glomerular filtration rate was 80.4 mL/min/1.73 m², which were also similar to the DPP4 inhibitor group. Baseline characteristics were likewise comparable in the GLP-1 RA versus DPP4 inhibitor cohort and in the SGLT2 inhibitor versus GLP-1 RA cohort.
Risk of hypomagnesemia after initiating SGLT2 inhibitors, GLP-1 RAs and DPP4 inhibitors
After a mean follow-up of 34.2 months, we observed 92,352 hypomagnesemia events in the SGLT2 inhibitor versus DPP4 inhibitor cohort. The risk difference was −6.40% (95% CI: −6.55%, −6.25%; p < 0.05), and SGLT2 inhibitor use was associated with a lower rate of hypomagnesemia, compared with DPP4 inhibitors (HR: 0.80; 95% CI: 0.79, 0.82; p < 0.05). After a mean follow-up of 36.1 months, we observed 84,870 events in the GLP-1 RA versus DPP4 inhibitor cohort. The risk difference was −5.48% (95% CI: −5.65%, −5.31%; p < 0.05), and GLP-1 RAs use was associated with a lower rate of hypomagnesemia, compared with DPP4 inhibitors (HR: 0.89; 95% CI: 0.88, 0.91; p < 0.05). Finally, after a mean follow-up of 29.7 months, we observed 77,463 events in the SGLT2 inhibitor versus GLP-1 RA cohort. The risk difference was −0.78% (95% CI: −0.93%, −0.64%; p < 0.05), and SGLT2 inhibitors were associated with a lower rate of hypomagnesemia than GLP-1 RAs (HR: 0.92; 95% CI: 0.91, 0.93; p < 0.05). Figures 2–4 and S8 Table show the cumulative incidence curves and HRs across different time intervals for all three cohorts, respectively.
Kaplan–Meier event-free curves for SGLT2 inhibitors vs. DPP4 inhibitors for risk of hypomagnesemia after 1:1 propensity score matching.
Kaplan–Meier event-free curves for GLP-1 RAs vs. DPP4 inhibitors for risk of hypomagnesemia after 1:1 propensity score matching.
Kaplan–Meier event-free curves for SGLT2 inhibitors vs. GLP-1 RAs for risk of hypomagnesemia after 1:1 propensity score matching.
Comparative effectiveness of individual SGLT2 inhibitors and GLP-1 RAs versus DPP4 inhibitors
Compared with DPP4 inhibitors, the observed lower risks of hypomagnesemia were consistent for canagliflozin (HR: 0.75; 95% CI: 0.73, 0.78; p < 0.05), dapagliflozin (HR: 0.88; 95% CI: 0.87, 0.90; p < 0.05), empagliflozin (HR: 0.84; 95% CI: 0.83, 0.85; p < 0.05), and ertugliflozin (HR: 0.91; 95% CI: 0.83, 0.997; p < 0.05). The results were also consistent for albiglutide (HR: 0.86; 95% CI: 0.75, 0.99; p < 0.05), dulaglutide (HR: 0.94; 95% CI: 0.93, 0.96; p < 0.05), exenatide (HR: 0.93; 95% CI: 0.89, 0.97; p < 0.05), liraglutide (HR: 0.88; 95% CI: 0.86, 0.89; p < 0.05), and semaglutide (HR: 0.84; 95% CI: 0.82, 0.85; p < 0.05), but not for lixisenatide (HR: 0.98; 95% CI: 0.90, 1.07; p = 0.638) (S9 Table).
Subgroup and sensitivity analyses
SGLT2 inhibitors and GLP-1 RAs showed lower risks of hypomagnesemia across all subgroups, including different ages (<60 or ≥60 years), sex (female or male), HbA1c levels (<7 or ≥7%), eGFR categories (30−60 or ≥60 mL/min/1.73 m^2^), and presence of CKD (yes or no), compared with DPP4 inhibitors (Table 2). The findings from the subgroup analyses of the SGLT2 inhibitor versus GLP-1 RA cohort were consistent with those in the main analysis (Table 2). The results of the sensitivity analyses were also consistent with the main analysis (S10 Table).
Table 2: Results of main and subgroup analyses after 1:1 propensity score matching.
Positive and negative control outcome analyses
Representing a known association, the initiation of SGLT2 inhibitors was associated with a significantly lower risk of incident hyperkalemia, compared with both DPP4 inhibitors (HR: 0.84; 95% CI: 0.82, 0.86; P < 0.05) and GLP-1 RAs (HR: 0.96; 95% CI: 0.94, 0.98; P < 0.05). Similarly, GLP-1 RA use was associated with a lower risk of hyperkalemia, compared with DPP4 inhibitors (HR: 0.91; 95% CI: 0.89, 0.93; P < 0.05) (S10 Table). Furthermore, we observed no significant risk difference in incident appendicitis across the three cohort comparisons (HR: 1.03, 95% CI: 0.93, 1.14; P = 0.602 for SGLT2 inhibitors versus DPP4 inhibitors; HR: 1.07, 95% CI: 0.96; 1.19; P = 0.594 for GLP-1 RAs versus DPP4 inhibitors; HR: 0.97; 95% CI: 0.88, 1.08; P = 0.229 for SGLT2 inhibitors versus GLP-1 RAs) (S10 Table).
Discussion
In this target trial emulation study, our findings suggested that, compared with DPP4 inhibitors, both SGLT2 inhibitors and GLP-1 RAs were associated with reductions in the risk of hypomagnesemia in adults with type 2 diabetes. Notably, the consistent results across a range of individual SGLT2 inhibitors (canagliflozin, dapagliflozin, empagliflozin, and ertugliflozin) and GLP-1 receptor agonists (albiglutide, dulaglutide, exenatide, liraglutide, and semaglutide) underscore the potential class benefits of SGLT2 inhibitors and GLP-1 RAs in maintaining magnesium homeostasis beyond their cardiorenal advantages. In the head-to-head comparisons of SGLT2 inhibitors versus GLP-1 RAs, we observed an additional reduction in the risk of hypomagnesemia after initiation of SGLT2 inhibitors. These results provide evidence of the real-world comparative effectiveness with regard to hypomagnesemia of the three most commonly used second-line antihyperglycemic drug classes, and could guide the choice of these drug classes in clinical practice.
Compared with previous studies, our investigation addressed several key knowledge gaps in existing literature. First, previous studies indicated increases of serum magnesium level by 0.07 mmol/L after SGLT2 inhibitor use in short-term treatment (<1 year) [13]. Our study extended these results to the reduction in risk of hypomagnesemia, as defined by clinical diagnosis or serum magnesium <1.80 mg/dL. Second, two previous studies excluded patients with moderate to severe CKD, potentially limiting the generalizability of their results as regards patients with poor renal functions [37,38]. Our study included a diverse population spanning a wide range of renal functions, and our findings from the subgroup analyses (e.g., eGFR 30−60 or ≥60 mL/min/1.73m^2^, and with or without CKD diagnosis) indicated consistent reductions in the risk of hypomagnesemia in patients receiving SGLT2 inhibitors who had different renal functions at baseline. Finally, previous reports have indicated that GLP-1 RAs potentially reduce magnesium excretion [14], but recent case reports have suggested that the prominent gastrointestinal symptoms from GLP-1 RAs increased the risk of hypomagnesemia [39,40]. Our study provides evidence that treatment with GLP-1 RAs is associated with a reduced risk of hypomagnesemia, possibly because the benefits of improved glycemic control outweigh the gastrointestinal effects on magnesium homeostasis.
SGLT2 inhibitors and GLP-1 RAs appear to mitigate the risk of hypomagnesemia in patients with type 2 diabetes, and some potential mechanisms of this pleiotropic effect on magnesium homeostasis have been proposed. Driven by upregulated transient receptor potential melastatin 6 (TRPM6) channels and elevated uromodulin expression according to proteomic analyses from the EMPEROR-Reduced and EMPEROR-Preserved trials [41,42], SGLT2 inhibitors have been found to enhance magnesium reabsorption in the distal convoluted tubule. Also, osmotic diuresis and mild volume contraction during use of SGLT2 inhibitors can transiently increase serum magnesium and trigger hormonal shifts (e.g., heightened glucagon and vasopressin) that boost renal magnesium reclamation [13,43]. Finally, SGLT2 inhibitor treatment improves insulin sensitivity, which protects against magnesium loss by reducing intracellular shifts, mitigating renal hyperfiltration, and enhancing TRPM6-mediated magnesium uptake in the distal convoluted tubule. Additionally, GLP-1 may have regulatory effects on intestinal magnesium absorption via modulation of hormonal or autonomic pathways [44–50]. The beneficial effects of GLP-1 RAs on magnesium homeostasis are likely to be partly indirect, mediated through improvements in hyperglycemia, insulin resistance, and other components of the metabolic syndrome [49,51–53]. Better glycemic control and reduced insulin resistance may lessen urinary magnesium wasting and enhance renal magnesium retention, while weight loss and overall metabolic improvements further support the normalization of magnesium balance [54,55]. Of note, compared with SGLT2 inhibitors, GLP-1 RAs were associated with a greater reduction in the risk of hypomagnesemia during the first year of follow-up, probably reflecting their more pronounced early effects on glucose control and weight reduction [11], which may have contributed to an initial improvement in magnesium balance. Together, these actions may explain the observed preservation of serum magnesium concentrations during treatment with either class of agents.
Our drug-specific HRs were directionally consistent with a class effect of SGLT2 inhibitors on serum magnesium, although the magnitudes varied. Prior evidence indicates that SGLT2 inhibitors generally increase serum Mg^2+^ concentrations, with drug-level differences plausibly related to varying SGLT2 and SGLT1 selectivity [56–58]. Post-hoc and meta-analytic data suggest that canagliflozin may produce greater mean increases in serum Mg^2+^ and higher rates of normalization among patients with hypomagnesemia, whereas ertugliflozin shows smaller average increases, consistent with our observed rank order [13,59–61]. Nonetheless, our HRs represent comparative effectiveness within this cohort and should not be interpreted as evidence of direct pharmacological superiority among the drugs.
Hypomagnesemia is frequently under-recognized in patients with type 2 diabetes [51,62,63], despite its association with increased cardiovascular risk, insulin resistance, and poor glycemic controls [51,63–65]. Our findings highlight a potentially important pleiotropic benefit of SGLT2 inhibitors and GLP-1 RAs, in that they attenuate magnesium loss. By improving magnesium homeostasis, these agents may contribute to broader metabolic stability and reduce arrhythmic or vascular complications [66]. However, these hypothetical mechanisms require further validation. Clinicians should be aware of this effect when selecting antihyperglycemic therapy, especially in patients at risk of hypomagnesemia. Understanding and leveraging the mineral-regulating properties of SGLT2 inhibitors and GLP-1 RAs should be recognized as a way to further optimize diabetes care beyond glycemic controls.
The large sample size constituted a major strength of this study, permitting detailed evaluation of both important subpopulations and individual drugs by using target trial emulation design with three comparison cohorts (SGLT2 inhibitors versus DPP4 inhibitors, GLP-1 RAs versus DPP4 inhibitors and SGLT2 inhibitors versus GLP-1 RAs), thus giving evidence of the real-world comparative effectiveness with regard to hypomagnesemia of the three most commonly used second-line antihyperglycemic drug classes. However, our study has several limitations. First, we matched a wide range of potential confounders, including kidney function and glycemic levels, in the propensity score model to reduce confounding and selection bias, but residual confounding inherent to retrospective observational research could not be totally ruled out. For example, we did not include any data on dietary magnesium intake and over-the-counter drugs, such as vitamins and mineral supplements paid for by patients. In addition, some patients may have been lost to follow-up or had missing data during the study period, especially given our study’s relatively long follow-up (around 128 weeks). However, any effect from such issues should be evenly distributed across groups under the new-user and active-comparator design used in this study [67]. Moreover, the findings from our positive (hyperkalemia) and negative (appendicitis) control outcome analyses indicated that the presence of unmeasured systematic bias was unlikely, thus supporting the study’s internal validity. Third, our subgroup analyses by individual SGLT2 inhibitors and GLP-1 RAs demonstrated consistent associations with reduced hypomagnesemia risk, though with varying effect sizes. Further head-to-head comparative studies are warranted to clarify the differential risks within each drug class. Fourth, the validity of the ICD-10-CM hypomagnesemia codes in the TriNetX database has not been investigated before, so misclassification of outcomes may have occurred. To increase the validity of our outcome definitions, we also included objective laboratory parameters (serum magnesium <1.80 mg/dL) in the study outcome definition, further reducing the likelihood of misclassification bias in our results. Fifth, we were unable to perform a competing risk analysis, which would have more appropriately accounted for events such as mortality that could influence our primary outcomes, as this function is not supported by the TriNetX platform. However, based on the findings from our negative control outcome analysis (appendicitis), we believe that the impact of death on our primary outcomes was likely minimal. Finally, our observed effect sizes should only be interpreted as intention-to-treat principles with the goal of influencing the selection of medical therapy for well-defined groups of patients [68].
In this target trial emulation study, patients with type 2 diabetes who initiated treatment with SGLT2 inhibitors or GLP-1 RAs showed a reduced risk of hypomagnesemia, compared with similar patients who initiated treatment with DPP4 inhibitors. SGLT2 inhibitors and GLP-1 RAs may be considered to reduce the risk of hypomagnesemia in a broad range of patients with type 2 diabetes.
Ethics approval and consent to participate
As the data were routinely collected and fully anonymized, patient consent was not required. The study protocol was approved by the institutional review board of Taiwan’s Chang Gung Medical Foundation (No: 202401883B0).
Supporting information
S1 FigStudy design diagram.(TIF)
S2 FigPropensity score distributions.(TIF)
S1 TableChecklist for the TARGET guidelines.(DOCX)
S2 TableSpecification and emulation of a target trial evaluating the effect of SGLT2 inhibitors, GLP-1 RAs, and DPP4 inhibitors on the risk of hypomagnesemia events using the TriNetX Global Collaborative Network.(DOCX)
S3 TableDisease diagnosis codes for the exclusion criteria.(DOCX)
S4 TableCodes to identify the exposure or comparator drugs.(DOCX)
S5 TableDisease diagnosis codes to identify baseline comorbidities.(DOCX)
S6 TableCodes to identify comedications.(DOCX)
S7 TableR code for running propensity score matching and Cox proportional hazards model analysis.(DOCX)
S8 TableHypomagnesemia risk across different follow-up time intervals after 1:1 propensity score matching.(DOCX)
S9 TableHypomagnesemia risk by individual drugs after 1:1 propensity score matching.(DOCX)
S10 TableResults of sensitivity analyses.(DOCX)
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Adomako EA, Alan S. Magnesium disorders: core curriculum 2024. Am J Kidney Dis. 2024. 10.1053/j.ajkd.2023.10.017 38372687 · doi ↗ · pubmed ↗
- 2Touyz RM, de Baaij JH, Hoenderop JG. Magnesium disorders. N Engl J Med. 2024;390:1998–2009. 10.1056/nejmra 1510603 38838313 · doi ↗ · pubmed ↗
- 3Zinman B, Wanner C, Lachin JM, Fitchett D, Bluhmki E, Hantel S, et al. Empagliflozin, cardiovascular outcomes, and mortality in type 2 diabetes. N Engl J Med. 2015;373(22):2117–28. doi: 10.1056/NEJ Moa 1504720 26378978 · doi ↗ · pubmed ↗
- 4Packer M, Anker SD, Butler J, Filippatos G, Pocock SJ, Carson P, et al. Cardiovascular and renal outcomes with empagliflozin in heart failure. N Engl J Med. 2020;383(15):1413–24. doi: 10.1056/NEJ Moa 2022190 32865377 · doi ↗ · pubmed ↗
- 5Anker SD, Butler J, Filippatos G, Ferreira JP, Bocchi E, Böhm M, et al. Empagliflozin in heart failure with a preserved ejection fraction. N Engl J Med. 2021;385(16):1451–61. doi: 10.1056/NEJ Moa 2107038 34449189 · doi ↗ · pubmed ↗
- 6The EMPA-KIDNEY Collaborative Group, Herrington WG, Staplin N, Wanner C, Green JB, Hauske SJ, et al. Empagliflozin in patients with chronic kidney disease. N Engl J Med. 2023;388(2):117–27. doi: 10.1056/NEJ Moa 2204233 36331190 PMC 7614055 · doi ↗ · pubmed ↗
- 7Mc Murray JJV, Solomon SD, Inzucchi SE, Køber L, Kosiborod MN, Martinez FA, et al. Dapagliflozin in patients with heart failure and reduced ejection fraction. N Engl J Med. 2019;381(21):1995–2008. doi: 10.1056/NEJ Moa 1911303 31535829 · doi ↗ · pubmed ↗
- 8Wiviott SD, Raz I, Bonaca MP, Mosenzon O, Kato ET, Cahn A, et al. Dapagliflozin and cardiovascular outcomes in type 2 diabetes. N Engl J Med. 2019;380(4):347–57. doi: 10.1056/NEJ Moa 1812389 30415602 · doi ↗ · pubmed ↗
