Abstract
Background
Epilepsy affects 1.2 % of the US population, with one-third of cases being drug-resistant. Magnesium modulates neuronal excitability, and dietary insufficiency may elevate seizure risk. Systemic inflammation, quantified by the Composite Dietary Antioxidant Index (CDAI), represents a plausible mediator, but population-level evidence remains limited.
Objective
To investigate associations between dietary magnesium intake and epilepsy prevalence, assess CDAI-mediated pathways, and identify high-benefit subgroups.
Methods
Cross-sectional analysis included 33,486 adults (≥20 years) from NHANES 2013–2018. Dietary magnesium intake was derived from two 24-hour recalls and analyzed continuously (per SD) and categorically (quartiles). Epilepsy was self-reported. CDAI integrated six micronutrient intakes. Weighted multivariable logistic regression evaluated magnesium-epilepsy associations, adjusted for sociodemographic, clinical, and dietary covariates. Mediation analysis quantified CDAI’s role.
Results
After full adjustment, each SD increase in magnesium intake was associated with 62 % lower epilepsy prevalence (OR = 0.38, 95 % CI: 0.21–0.70, p = 0.004). Quartile analysis revealed a significant inverse trend (p-trend = 0.032), with Q4 (highest intake) exhibiting the lowest risk (OR = 0.38, 95 % CI: 0.12–1.15). CDAI mediated 50.1 % of magnesium’s protective effect (indirect effect: −0.478, 95 % CI: −1.031 to −0.166; p < 0.001). Stronger inverse associations occurred in Non-Hispanic Black (OR = 0.32, 95 % CI: 0.11–0.94) and Mexican American (OR = 0.35, 95 % CI: 0.16–0.76) individuals (p-interaction = 0.009) and those with obesity (OR = 0.26, 95 % CI: 0.10–0.68).
Conclusion
Higher dietary magnesium intake is associated with significantly reduced epilepsy prevalence in US adults, with half of this effect mediated by attenuated inflammation (CDAI). Populations with elevated inflammation burdens or socioeconomic disadvantages may derive particular benefit. These findings support magnesium-rich diets as a potential preventive strategy and warrant prospective validation.
Keywords: Epilepsy, Dietary Magnesium Intake, CDAI, NHANES
Graphical Abstract
Highlights
-
•
Dietary magnesium shows a strong, inverse association with epilepsy prevalence in US adults.
-
•
CDAI inflammation index mediates 50.1 % of magnesium's protective effect.
-
•
Significant inverse dose-response relationship between magnesium intake and epilepsy risk.
-
•
Stronger protective effects in African/Mexican Americans and individuals with obesity.
-
•
High-magnesium diet suggested as preventive strategy for inflammation-related epilepsy (Especially for high-inflammation or low-SES individuals).
1. Introduction
Approximately 1.2 % of the US population, which amounts to over 3 million adults and 470,000 children (Zack and Kobau, 2017, England et al., 2012), are affected by Epilepsy. This is a chronic neurological disorder recognized by recurrent unprovoked seizures. The condition brings about significant burdens. It leads to a rise in mortality, a decline in the quality of life, social stigma, and healthcare costs that are more than $15.5 billion each year (Kaplin and Williams, 2007, Begley et al., 2000). Even with progress in pharmacotherapy, around one - third of patients suffer from drug - resistant epilepsy, emphasizing the urgent requirement for new preventive and supplementary strategies (Kwan and Brodie, 2000).
An indispensable divalent cation, magnesium has a key part to play in neuronal excitability. It does so by regulating NMDA receptors, voltage-gated calcium channels, and GABAergic neurotransmission (Kirkland et al., 2018, Slutsky et al., 2004). Experimental data shows that a lack of magnesium reduces seizure thresholds and intensifies excitotoxicity (McDonald et al., 1990). Observational research has found an inverse link between magnesium levels and seizure frequency, and small trials have shown possible advantages of magnesium supplementation in cases of refractory epilepsy (Mauskop and Altura, 1998, Yuen and Sander, 2012). As an essential nutrient, dietary magnesium is vital for neural communication, ion channel control, and antioxidant protection. The lack of magnesium might result in heightened neuronal excitability, thus causing epileptic seizures. Findings suggest that due to the extensive intake of processed foods, the occurrence of magnesium deficiency in contemporary diets might be related to a heightened risk of epilepsy (Yary and Kauhanen, 2019). Data from epidemiological studies show significant nutritional disparities among those with epilepsy, with a notably high rate of magnesium deficiency, which offers a theoretical foundation for investigating dietary approaches (smail et al., 2022). At present, there is still a lack of sufficient population-based evidence connecting dietary magnesium consumption to the incidence of epilepsy, especially when it comes to the underlying mediating mechanisms.
A conceivable mediator is represented by chronic inflammation, which is measured by the Composite Dietary Antioxidant Index (CDAI). Proinflammatory cytokines can cause the blood-brain barrier to be disrupted, encourage glial activation, and increase neuronal excitability - crucial epileptogenic mechanisms (Vezzani et al., 2011, Vezzani et al., 2015). Magnesium demonstrates anti-inflammatory characteristics by suppressing NF-κB signaling and decreasing C-reactive protein (Mazur et al., 2007, Nielsen, 2010). In large epidemiological studies, whether the possible anti-epileptic effects of magnesium work via reducing inflammation has not been explored yet.
The National Health and Nutrition Examination Survey (NHANES) 2013–2018 is utilized in this research for the following purposes: Firstly, to explore the connection between the dietary intake of magnesium and the prevalence of epilepsy among US adults; Secondly, to analyze the mediating function of CDAI in this relationship; Thirdly, to pinpoint the population subgroups that are most likely to gain advantages.
2. Methods
2.1. Study population
We analyzed data from 33,486 adults (aged ≥20 years) participating in NHANES 2013–2018 cycles. Women who were pregnant and those with missing data regarding epilepsy status, dietary magnesium intake, or NHANES sampling weights were the criteria for exclusion. NHANES employs a complex, multistage probability sampling design to represent the non-institutionalized US population. Written informed consent was provided by all participants, and the protocols were approved by the NCHS Research Ethics Review Board (National Center for Health Statistics, 2023).
2.2. Dietary magnesium intake
The dietary intake was appraised through two 24-hour dietary recollections by applying the USDA Automated Multiple-Pass Method. Even though 24-hour recall methods may be affected by daily fluctuations and possible inaccurate reporting (either under or over), they offer more detailed data regarding actual consumption quantities compared to food frequency questionnaires (Prentice et al., 2011, Subar et al., 2003). For the purpose of analysis, magnesium was evaluated as a continuous variable (per standard deviation increase after logarithmic conversion). Also, participants were classified into four groups (the first group having the lowest intake and the fourth group having the highest intake) according to their reported dietary magnesium intake.
2.3. Composite Dietary Antioxidant Index (CDAI)
The CDAI integrates intakes of six antioxidant micronutrients (magnesium, selenium, zinc, vitamin A, vitamin C E) into a composite score using standardized z-scores: CDAI = Σ[(individual intake - mean)/standard deviation]. Greater overall antioxidant capacity from diet is indicated by higher scores (Wright et al., 2003).
2.4. The identification of epilepsy
Seizure events are not directly captured by NHANES. Rather, epilepsy status was determined via self - reports from participants during face - to - face interviews, adopting a method in line with earlier NHANES - based research (Zhang et al., 2024, Liu et al., 2024, Chen et al., 2024). If participants reported either (1) using at least one drug specifically prescribed for 'epilepsy and recurrent seizures' or (2) experiencing recurrent epileptic seizures (The International Classification of Diseases [ICD] code for “epilepsy and recurrent seizures” [G40] was used to categorize participants), they were categorized as having epilepsy. The names of medications and the main reason for each prescription were provided by the participants (Chen et al., 2025). Although this method might overlook undiagnosed cases or misclassify some people (for example, those using antiepileptic drugs for other reasons), it is a proven way to identify epilepsy cases in large population surveys such as NHANES.
2.5. Covariates
The model adjustments include age, sex, race/ethnicity, marital status, family poverty-income ratio (PIR), education level, smoking status, alcohol consumption, dietary supplement use, BMI, comorbid conditions (such as stroke, hypertension, diabetes), and dietary intakes of calcium, vitamin D, and selenium.
2.6. Statistical analysis
To guarantee national representativeness, NHANES sampling weights, clusters, and strata were included in all analyses. Categorical variables' baseline characteristics across magnesium quartiles were compared by means of Rao-Scott χ² tests, while weighted linear regression was employed for continuous variables. The odds ratios (ORs) and 95 % confidence intervals (CIs) for epilepsy across magnesium quartiles and per Standard Deviation (per SD) increase were estimated through weighted multivariable logistic regression. Three adjustment models were employed: Model 1 (without any adjustment), Model 2 (adjusted for age, sex, and race), and Model 3 (adjusted for all covariates). Continuous variables, such as median intake per quartile, were employed in trend tests. Non-linearity was evaluated using restricted cubic splines (RCS) featuring 3 knots. Interactions were examined through subgroup analyses. Mediation analysis quantified CDAI’s role using the product-of-coefficients method with bootstrapping (1000 replicates) (Valeri and Vanderweele, 2013). Analyses used R (version 4.2.0) and the survey, rms, and mediation packages. Statistical significance was set at p < 0.05 (two-tailed).
3. Results
3.1. Study population
From 38,360 eligible NHANES 2013–2018 participants aged ≥ 20 years, 4874 (12.7 %) were excluded due to pregnant women and missing dietary potassium intake data, resulting in an analytical sample of 33,486 participants.
3.2. Characteristics of the population
The weighted baseline characteristics of 461,687,061 participants from NHANES 2013 - 2018, stratified according to the quartiles of dietary magnesium intake, are presented in Table 1. Significant gradients (all p < 0.05 except where noted) were observed across magnesium quartiles for most demographic and clinical variables. Participants in higher magnesium quartiles (Q4) were younger (65.6 % aged <65 vs. 580 % in Q1, p = 0.013) and predominantly male (59.6 % in Q4 vs. 30.2 % in Q1, p < 0.001).
Table 1.
Baseline characteristics of participants in the NHANES 2013-2018 cycles, weighted.
| Variables | level | Overall | Quartiles of magnesium (mg) | p | |||
|---|---|---|---|---|---|---|---|
| Q1 | Q2 | Q3 | Q4 | ||||
| n | 461687061.7 | 100791003.2 | 114429904.1 | 122373730.8 | 124092423.7 | ||
| Age(%) | 0.013 | ||||||
| < 65 | 277689723.9 (60.1) | 58459974.9 (58.0) | 66315633.3 (58.0) | 71516912.7 (58.4) | 81397202.9 (65.6) | ||
| ≥ 65 | 183997337.9 (39.9) | 42331028.2 (42.0) | 48114270.8 (42.0) | 50856818.1 (41.6) | 42695220.8 (34.4) | ||
| Sex (%) | < 0.001 | ||||||
| Male | 200147329.8 (43.4) | 30428725.8 (30.2) | 38407208.2 (33.6) | 57309860.0 (46.8) | 74001535.8 (59.6) | ||
| Female | 261539731.9 (56.6) | 70362277.3 (69.8) | 76022695.9 (66.4) | 65063870.8 (53.2) | 50090887.9 (40.4) | ||
| Race(%) | 0.002 | ||||||
| Non-Hispanic White | 23219154.9 ( 5.0) | 4559068.3 ( 4.5) | 4790903.0 ( 4.2) | 6600341.6 ( 5.4) | 7268841.9 ( 5.9) | ||
| Non-Hispanic Black | 19136708.0 ( 4.1) | 4560400.1 ( 4.5) | 4161774.2 ( 3.6) | 5011449.1 ( 4.1) | 5403084.5 ( 4.4) | ||
| Mexican American | 339776532.1 (73.6) | 69296496.0 (68.8) | 86521274.2 (75.6) | 91012198.2 (74.4) | 92946563.7 (74.9) | ||
| Others | 79554666.8 (17.2) | 22375038.6 (22.2) | 18955952.8 (16.6) | 19749741.8 (16.1) | 18473933.6 (14.9) | ||
| Marital status(%) | < 0.001 | ||||||
| Married or living with a partner | 286642858.0 (62.1) | 56740876.7 (56.3) | 66434268.7 (58.1) | 78656524.3 (64.3) | 84811188.3 (68.3) | ||
| Living alone | 174889839.2 (37.9) | 43973736.5 (43.7) | 47995635.4 (41.9) | 43639232.0 (35.7) | 39281235.4 (31.7) | ||
| Family income(%) | < 0.001 | ||||||
| Low (≤ 1.3) | 92763922.7 (21.7) | 28435481.4 (30.6) | 25483752.7 (24.1) | 21270611.9 (18.8) | 17574076.7 (15.2) | ||
| Medium (1.3–3.5) | 158916602.8 (37.2) | 35873885.4 (38.6) | 42035445.7 (39.8) | 42648275.8 (37.7) | 38358996.0 (33.1) | ||
| High (>3.5) | 175687482.9 (41.1) | 28551295.7 (30.7) | 38010508.1 (36.0) | 49160209.6 (43.5) | 59965469.5 (51.7) | ||
| Educational level(%) | < 0.001 | ||||||
| < 9 | 21655155.2 ( 4.7) | 6336587.0 ( 6.3) | 5788712.9 ( 5.1) | 5146360.9 ( 4.2) | 4383494.4 ( 3.5) | ||
| 9–12 | 156952936.3 (34.0) | 42315566.3 (42.0) | 40667832.2 (35.5) | 41307770.0 (33.8) | 32661767.8 (26.3) | ||
| > 12 | 282907680.3 (61.3) | 52108629.2 (51.7) | 67941540.6 (59.4) | 75919599.9 (62.0) | 86937910.6 (70.1) | ||
| Smoking status(%) | 0.002 | ||||||
| Never | 226768472.4 (49.2) | 45909457.8 (45.6) | 59125459.0 (51.7) | 61223167.3 (50.0) | 60510388.3 (48.8) | ||
| Former | 155225761.5 (33.6) | 31036099.6 (30.8) | 36128023.3 (31.6) | 43035446.7 (35.2) | 45026191.9 (36.3) | ||
| Current | 79338939.3 (17.2) | 23667550.0 (23.5) | 19167118.3 (16.8) | 18115116.8 (14.8) | 18389154.2 (14.8) | ||
| Alcohol drinking status(%) | < 0.001 | ||||||
| Never | 44926906.0 (11.0) | 13165993.4 (15.1) | 12003655.6 (11.8) | 11057816.1 (10.2) | 8699440.9 ( 7.8) | ||
| Former | 69302800.8 (17.0) | 18925396.0 (21.7) | 17042863.9 (16.8) | 19002284.1 (17.6) | 14332256.8 (12.9) | ||
| Current | 293860216.5 (72.0) | 54997394.1 (63.2) | 72591842.2 (71.4) | 78153439.3 (72.2) | 88117541.0 (79.3) | ||
| BMI(%) | < 0.001 | ||||||
| < 25 | 86612884.9 (19.1) | 16527895.6 (16.7) | 23244973.5 (20.7) | 18917700.4 (15.6) | 27922315.3 (22.8) | ||
| 25–30 | 133030492.5 (29.3) | 25148259.2 (25.4) | 31255357.3 (27.9) | 39703314.8 (32.8) | 36923561.1 (30.2) | ||
| ≥ 30 | 234856075.8 (51.7) | 57204994.2 (57.9) | 57525406.5 (51.4) | 62572097.2 (51.6) | 57553577.8 (47.0) | ||
| Stroke (%) | 0.011 | ||||||
| No | 421629007.5 (91.5) | 89762029.3 (89.3) | 103634580.4 (90.6) | 111733827.1 (91.3) | 116498570.6 (94.2) | ||
| Yes | 39293310.3 ( 8.5) | 10770802.7 (10.7) | 10752672.2 ( 9.4) | 10626771.3 ( 8.7) | 7143064.1 ( 5.8) | ||
| Hypertension (%) | 0.023 | ||||||
| No | 148421690.2 (32.1) | 27813203.0 (27.6) | 35971466.6 (31.4) | 39754325.1 (32.5) | 44882695.5 (36.2) | ||
| Yes | 313265371.6 (67.9) | 72977800.2 (72.4) | 78458437.5 (68.6) | 82619405.7 (67.5) | 79209728.2 (63.8) | ||
| Diabetes(%) | 0.015 | ||||||
| No | 294287096.0 (63.9) | 60617914.1 (60.3) | 75506755.1 (66.2) | 75665969.9 (62.1) | 82496457.0 (66.7) | ||
| Yes | 166018289.2 (36.1) | 39931929.5 (39.7) | 38621907.0 (33.8) | 46236385.5 (37.9) | 41228067.1 (33.3) | ||
| Dietary supplement (%) | < 0.001 | ||||||
| No | 135731628.4 (29.4) | 37239574.6 (36.9) | 29462473.1 (25.7) | 33299041.9 (27.2) | 35730538.7 (28.8) | ||
| Yes | 325912535.2 (70.6) | 63551428.5 (63.1) | 84967431.0 (74.3) | 89038369.6 (72.8) | 88355306.1 (71.2) | ||
| dietary calcium intake (mg)(mean (SD)) | 905.57 (533.75) | 487.55 (270.84) | 758.68 (371.00) | 965.01 (414.93) | 1321.94 (604.16) | < 0.001 | |
| dietary vitamin d intake (mg)(mean (SD)) |
4.39 (5.26) | 2.09 (2.80) | 3.46 (3.60) | 4.57 (4.48) | 6.93 (7.31) | < 0.001 | |
| dietary selenium intake (mg)(mean (SD)) | 107.88 (61.15) | 63.05 (31.52) | 90.27 (36.07) | 115.46 (46.06) | 153.07 (76.15) | < 0.001 | |
| Epilepsy (%) | 0.429 | ||||||
| No | 459253209.0 (99.5) | 100200475.4 (99.4) | 113716327.6 (99.4) | 121671857.1 (99.4) | 123664549.0 (99.7) | ||
| Yes | 2433852.7 ( 0.5) | 590527.7 ( 0.6) |
713576.5 ( 0.6) | 701873.7 ( 0.6) | 427874.7 ( 0.3) |
||
Notable socioeconomic disparities emerged: Q4 participants exhibited higher educational attainment (70.1 % with >12 years education vs. 51.7 % in Q1, p < 0.001), greater family income (51.7 % high income vs. 30.7 % in Q1, p < 0.001), and higher marriage rates (68.3 % vs. 56.3 %, p < 0.001). Mexican Americans constituted the predominant racial group across all quartiles (68.8–75.6 %).
Clinical characteristics showed progressively favorable profiles with increasing magnesium intake: lower obesity prevalence (Q4:47.0 % BMI≥30 vs. Q1:57.9 %, p < 0.001), reduced stroke history (5.8 % vs. 107 %, p = 0.011), and lower hypertension (63.8 % vs. 72.4 %, p = 0.023) and diabetes (33.3 % vs. 39.7 %, p = 0.015). Nutrient co-exposures demonstrated strong positive correlations, with Q4 showing substantially higher mean calcium (1321.94 mg vs. 487.55 mg), vitamin D (6.93 mg vs. 2.09 mg), and selenium (153.07 mg vs. 63.05 mg) (all p < 0.001).
Critically, epilepsy prevalence did not differ significantly across quartiles (p = 0.429), ranging from 0.6 % (Q1) to 0.3 % (Q4). Dietary supplement usage was prevalent (70.6 % overall), with significant variation across quartiles (p < 0.001).
3.3. Multivariable regression
The results of multivariable logistic regression are summarized in Table 2. After full adjustment for sociodemographic, lifestyle, dietary, and comorbidity covariates (Model 3), a significant inverse association was observed between dietary magnesium intake (per Standard Deviation [per SD] increase) and epilepsy prevalence (Odds Ratio [OR] = 0.38, 95 % CI: 0.21, 0.70, p = 0.004)(Fig. 1). Analysis by quartiles revealed a significant inverse trend across increasing quartiles of magnesium intake in the fully adjusted model (p-trend = 0.032). Participants in the highest quartile (Q4) exhibited the lowest risk of epilepsy (OR = 0.38, 95 % CI: 0.12, 1.15, p = 0.083) compared to the lowest quartile (Q1), although this specific comparison did not reach conventional statistical significance in Model 3.
Table 2.
Weighted multivariable logistic regression analysis of the association between dietary magnesium intake and epilepsy.
| model 1 |
model 2 |
model 3 |
|||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| OR | CI | P_value | OR | CI | P_value | OR | CI | P_value | |||
| magnesium (mg) | 0.67 | 0.48, 0.94 | 0.022 | 0.58 | 0.43, 0.78 | < 0.001 | 0.38 | 0.21, 0.70 | 0.004 | ||
| Quartile of magnesium (mg) | |||||||||||
| 1 | Ref | Ref | Ref | ||||||||
| 2 | 1.06 | 0.49, 2.30 | 0.87 | 1.03 | 0.47, 2.22 | 0.948 | 0.93 | 0.32, 2.71 | 0.893 | ||
| 3 | 0.98 | 0.53, 1.79 | 0.943 | 0.83 | 0.47, 1.46 | 0.503 | 0.80 | 0.31, 2.09 | 0.632 | ||
| 4 | 0.59 | 0.29, 1.18 | 0.131 | 0.41 | 0.20, 0.85 | 0.017 | 0.38 | 0.12, 1.15 | 0.083 | ||
| Trend test | 0.075 | 0.002 | 0.032 | ||||||||
Model 1: not adjusted for covariates.
Model 2: adjusted for age, sex, race.
Model 3: adjusted for age, sex, race, marital status, family income, educational level, smoking status, alcohol drinking status, dietary supplements, BMI,dietary calcium intake,dietary vitamin d intake,dietary selenium intake,stroke, hypertension, diabetes.
Fig. 1.
Weighted restricted cubic spline curve of dietary magnesium intake and epilepsy risk. Adjusted for all Model 3 covariates.
3.4. Subgroup analyses
The results of subgroup analyses are summarized in Table 3, Fig. 2. The protective association of higher magnesium intake was consistent across most subgroups defined by age, sex, alcohol status, BMI, stroke history, and hypertension status (p-interaction > 0.05). However, a significant interaction by race/ethnicity was identified (p-interaction = 0.009). The inverse association was particularly pronounced in Non-Hispanic Black (OR = 0.32, 95 % CI: 0.11, 0.94, p = 0.04) and Mexican American (OR = 0.35, 95 % CI: 0.16, 0.76, p = 0.01) individuals, but was not statistically significant in Non-Hispanic White individuals (OR = 0.98, 95 % CI: 0.14, 6.85, p = 0.98). Obesity (BMI ≥ 30 kg/m²) amplified the protective effect (OR = 0.26; 0.10–0.68). A significant inverse association was also observed in individuals without diabetes (OR = 0.37, 95 % CI: 0.19, 0.70, p = 0.004) but not in those with diabetes (p-interaction = 0.402).
Table 3.
Weighted subgroup analyses of the association between dietary magnesium intake and epilepsy.
| Level | OR(95 %CI) | P value | P for interaction_LRT | P for interaction_Wald |
|---|---|---|---|---|
| Age | 0.467 | 0.461 | ||
| < 65 | 0.40(0.21, 0.74) | 0.01 | ||
| ≥ 65 | 0.31(0.10, 1.00) | 0.05 | ||
| Sex | 0.992 | 0.993 | ||
| Male | 0.46(0.24, 0.91) | 0.03 | ||
| Female | 0.49(0.19, 1.26) | 0.13 | ||
| Race | 0.01 | 0.009 | ||
| Non-Hispanic White | 0.98(0.14, 6.85) | 0.98 | ||
| Non-Hispanic Black | 0.32(0.11, 0.94) | 0.04 | ||
| Mexican American | 0.35(0.16, 0.76) | 0.01 | ||
| Others | 0.61(0.20, 1.86) | 0.37 | ||
| Alcohol drinking status | 0.517 | 0.683 | ||
| Never | 0.18(0.04, 0.76) | 0.02 | ||
| Former | 0.09(0.01, 0.81) | 0.03 | ||
| Current | 0.68(0.41, 1.12) | 0.12 | ||
| BMI | 0.305 | 0.189 | ||
| < 25 | 0.81(0.20, 3.20) | 0.75 | ||
| 25–30 | 1.03(0.26, 4.17) | 0.96 | ||
| ≥ 30 | 0.26(0.10, 0.68) | 0.01 | ||
| Stroke | 0.224 | 0.213 | ||
| No | 0.46(0.26, 0.81) | 0.01 | ||
| Yes | 0.30(0.07, 1.24) | 0.09 | ||
| Hypertension | 0.962 | 0.964 | ||
| No | 0.40(0.18, 0.90) | 0.03 | ||
| Yes | 0.46(0.22, 0.95) | 0.04 | ||
| Diabetes | 0.416 | 0.402 | ||
| No | 0.37(0.19, 0.70) | 0.004 | ||
| Yes | 0.74(0.15, 3.71) | 0.71 |
Fig. 2.
Weighted forest plot of subgroup analyses for the association between dietary magnesium intake (per SD increase) and epilepsy. Results are presented as Odds Ratios (OR) and 95 % Confidence Intervals from fully adjusted models (Model 3). P-values for interaction are shown (LRT: Likelihood Ratio Test).
3.5. Mediation analysis
Fig. 3 presents the results of mediation analysis. Adjusted for all Model 3 covariates, demonstrated a significant indirect effect of dietary magnesium intake on epilepsy risk mediated through CDAI (Indirect Effect = −0.478, 95 % CI: −1.031, −0.166, p < 0.001). The total effect of magnesium on epilepsy was significant (Total Effect = −0.955, 95 % CI: −1.548, −0.418, p < 0.001). The direct effect of magnesium, independent of CDAI, was not statistically significant (Direct Effect = −0.603, 95 % CI: −1.300, 0.119, p = 0.08). CDAI mediated approximately 50.1 % (Proportion Mediated = 0.501, 95 % CI: 0.159, 1.425, p < 0.001) of the total observed association between dietary magnesium intake and epilepsy risk.
Fig. 3.
Weighted mediation analysis of CDAI in the association between dietary magnesium intake and epilepsy. Adjusted for Model 3.
3.6. Sensitivity analysis
In the analysis sample comprising 33,486 participants, multiple imputation was employed for missing covariates. After adjusting multiple models to exclude the effects of co-morbidities, such as stroke, hypertension, diabetes, and also exclude the effects of dietary supplements, dietary calcium intake, dietary selenium intake, and dietary vitamin D intake on the outcomes, the results of the multivariate regression analysis remained stable following multiple model adjustments.
4. Discussion
Findings from this study, which is representative at the national level, offer new proof that a greater intake of dietary magnesium in US adults is notably linked to a lower prevalence of epilepsy. Significantly, it is shown that approximately 50 % of this protective effect is mediated by reduced systemic inflammation, as quantified by the CDAI. The understanding of how diet provides neuroprotection has been furthered by these discoveries, which also offer insights into the mechanisms for preventing epilepsy.
Previous cross-sectional studies have shown that epilepsy patients commonly exhibit inadequate magnesium intake (average consumption below recommended levels), which correlates with poor seizure control; for instance, patients with low vegetable intake and high-calorie diets face a 2.3-fold increased risk of seizures (Baek et al., 2018). In ketogenic diet (KD) therapy for refractory epilepsy, inadequate magnesium supplementation is a prominent issue. Whilst supplementation protocols improve vitamin B12 levels, they offer limited correction for deficiencies in minerals such as calcium and magnesium (Prudencio et al., 2021). Approximately 50 % of adult epilepsy patients utilize dietary supplements, and magnesium supplementation is quite common. However, improper usage might lead to drug interactions or seizure uncontrollability, emphasizing the necessity for personalized monitoring (Joshi et al., 2019). Studies on the compliance of the Mediterranean diet (abundant in magnesium-rich foods such as nuts and leafy greens) among pediatric epilepsy patients suggest that high adherence is associated with an increased intake of minerals like iron and magnesium, potentially decreasing seizure frequency by improving neuronal stability (Bosak et al., 2019). These advances highlight the potential protective mechanisms of magnesium in epilepsy management, including regulating ion balance and mitigating oxidative stress (Kaner et al., 2022). Current supplementation procedures (such as magnesium agents in ketogenic diets) result in inconsistent outcomes, and some patients still have low magnesium levels even after supplementation. This is due to individual differences (for example, age, drug interactions) and the lack of standardised supplementation guidelines (Prudencio et al., 2021, Cilliers and Muller, 2021). There is still a lack of long-term efficacy data regarding magnesium supplementation for preventing epilepsy, and the safety and tolerability need further verification across various populations, including children and the elderly (Volpe et al., 2007, Verrotti et al., 2010).
In our research,the fully adjusted model (Model 3) indicated that the odds of epilepsy were 62 % lower in the group with the highest magnesium intake quartile (OR 0.38, 95 % CI 0.21–0.70) as compared to the group with the lowest intake. This inverse association exhibited a significant linear trend (p-trend=0.032) and persisted when magnesium was modeled continuously per SD increase (OR 0.46, 95 % CI 0.26–0.81). This aligns with experimental data showing magnesium suppresses hippocampal kindling and seizure susceptibility in animal models via NMDA receptor blockade [08 * MERGEFORMAT, (Cotton et al., 1992). Among pediatric patients with febrile seizures, the prevalence of low serum magnesium (<0.50 mmol/L) reached 42.9 %, significantly higher than that in healthy controls (6.9 %). This suggests magnesium deficiency may increase seizure susceptibility by affecting NMDA receptors (Volpe et al., 2007).Clinical studies report reduced seizure frequency following intravenous magnesium administration in eclampsia and hypomagnesemic epilepsy (Yuen and Sander, 2012, Mercer and Merlino, 2009). However, our study is the first large-scale epidemiological evidence linking dietary magnesium to reduced epilepsy prevalence in the general population, extending beyond acute therapeutic contexts.
The mediation analysis provides critical mechanistic insight: CDAI accounted for 50.1 % (p < 0.001) of magnesium’s protective effect. This provides support for the supposition that the anti-epileptic characteristics of magnesium are, to some extent, attributed to alleviating neuroinflammation. The NLRP3 inflammasome and NF-κB signaling are inhibited by magnesium, which leads to a reduction in pro-inflammatory cytokines such as IL-1β and TNF-α (Mazur et al., 2007, Nielsen, 2010). These cytokines are known to disrupt glutamate homeostasis, weaken GABAergic inhibition, and increase the permeability of the blood-brain barrier - all of which are acknowledged epileptogenic pathways (Zack and Kobau, 2017, Vezzani et al., 2011) Our findings suggest that modulating neuroinflammation and the subsequent seizure risk might be achievable by increasing the dietary antioxidant capacity, especially through magnesium. This holds biological plausibility considering the well - established part that inflammation plays in epileptogenesis and the therapeutic possibilities of anti - inflammatory approaches (D'Ambrosio et al., 2013).
Subgroup analyses identified populations potentially deriving greater benefit: Non-Hispanic Blacks (OR 0.32, 95 % CI 0.11–0.94), Mexican Americans (OR 0.35, 95 % CI 0.16–0.76), individuals with low income (OR 0.18, 95 % CI 0.05–0.64), BMI ≥ 30 (OR 0.26, 95 % CI 0.10–0.68), and those not using dietary supplements (OR 0.25, 95 % CI 0.09–0.73). Higher inflammation burdens and less-than-optimal magnesium intake are frequently encountered among these groups (Ford and Mokdad, 2003, Rosanoff et al., 2012), indicating that dietary interventions with a specific focus could bring about substantial public health advantages. The significant interaction by race/ethnicity (p-interaction=0.009) warrants further investigation into genetic, dietary, or social determinants influencing magnesium’s anti-inflammatory effects.
5. Limitations and strengths
Limitations include the cross-sectional design precluding causal inference, potential recall bias in dietary assessment, and reliance on self-reported epilepsy. The low epilepsy prevalence (0.5 %) may reflect underdiagnosis or coding limitations. Residual confounding remains possible despite extensive adjustments. However, strengths include the large, nationally representative sample, rigorous NHANES methodology, comprehensive covariate adjustment, and innovative evaluation of CDAI as a mediator. The dose-response relationship and biological plausibility strengthen the findings.
6. Conclusion and implications
In US adults, a notable connection exists between a greater intake of dietary magnesium and a significantly decreased prevalence of epilepsy. Approximately half of this impact is achieved through a reduction in inflammation (CDAI). Those populations bearing a higher inflammation burden or having a lower socioeconomic status might stand to gain the most. The potential of diets abundant in magnesium, such as those including leafy greens, nuts, and whole grains, to serve as a preventive measure against epilepsy is supported by these results. Prospective research in the future and randomized trials ought to verify causality and investigate targeted interventions among high-risk subgroups.
CRediT authorship contribution statement
Le Yang: Validation, Formal analysis. Jierong Yin: Visualization, Conceptualization. Yali Lai: Writing – review & editing, Writing – original draft, Validation, Supervision, Software, Resources, Methodology, Formal analysis, Conceptualization. Yi Zhou: Writing – review & editing, Visualization, Methodology, Data curation, Conceptualization.
Author Contributions
All authors made a significant contribution to the work reported, whether that is in the conception, study design, execution, acquisition of data, analysis and interpretation, or in all these areas.
Declaration of Generative AI and AI-assisted technologies in the writing process
During the preparation of this work, the author used clinicalscientists AI to assist in interpreting research results, reducing weight, and polishing the text. After using this tool/service, the author reviewed and edited the content as necessary and assumed full responsibility for the content of the publication.
Funding
This study was supported by the Chengdu Medical College Institutional Research, Project Sichuan Provincial Key Laboratory of Development and Regeneration Open Project 2023 Annual Programme (Grant Number: 23LHHGYSD26).
Conflicts of Interest
The authors declare no competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Acknowledgment
We sincerely thank the participants, staff, and investigators of the NHANES. We also acknowledge the Free Statistics team (Beijing, China) for providing their software and technical support for data analysis and visualization.
Footnotes
Supplementary data associated with this article can be found in the online version at doi:10.1016/j.ibneur.2026.02.005.
Appendix A. Supplementary material
Supplementary material
Data Availability
The datasets generated and/or analyzed during the current study are publicly available from the National Center for Health Statistics NHANES website: [https://www.cdc.gov/nchs/nhanes/about/index.html].
References
- Baek S.J., Byeon J.H., Eun S.H., Eun B.L., Kim G.H. Risk of low serum levels of ionized magnesium in children with febrile seizure. BMC Pedia. 2018;18(1):297. doi: 10.1186/s12887-018-1271-z. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Begley C.E., Famulari M., Annegers J.F., Lairson D.R., Reynolds T.F., Coan S., et al. The cost of epilepsy in the United States: an estimate from population-based clinical and survey data. Epilepsia. 2000;41(3):342–351. doi: 10.1111/j.1528-1157.2000.tb00166.x. [DOI] [PubMed] [Google Scholar]
- Bosak M., Mołek P., Słowik A. Use of dietary and herbal supplements in adult patients with epilepsy. Epilepsy Res. 2019;156 doi: 10.1016/j.eplepsyres.2019.106168. [DOI] [PubMed] [Google Scholar]
- Chen M., Chen J., Wang X., Long T. Serum Klotho levels and epilepsy among U.S. adults in the NHANES 2013-2016: a cross-sectional study. Sci. Rep. 2025;15(1) doi: 10.1038/s41598-025-97112-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Chen T., Wang B., Lu J., Jing L. Association of dietary vitamin K1 intake with epilepsy in adults in US: a cross-sectional study of National Health and Nutrition Examination Survey 2013-2018. BMC Public Health. 2024;24(1):3125. doi: 10.1186/s12889-024-20548-z. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Cilliers K., Muller C.J.F. Multi-element analysis of brain regions from South African Cadavers. Biol. Trace Elem. Res. 2021;199(2):425–441. doi: 10.1007/s12011-020-02158-z. [DOI] [PubMed] [Google Scholar]
- Cotton D.B., Janusz C.A., Berman R.F. Anticonvulsant effects of magnesium sulfate on hippocampal seizures: therapeutic implications in preeclampsia-eclampsia. Am. J. Obstet. Gynecol. 1992;166(4):1127–1134. doi: 10.1016/s0002-9378(11)90599-7. [DOI] [PubMed] [Google Scholar]
- D'Ambrosio R., Eastman C.L., Fattore C., Perucca E. Novel frontiers in epilepsy treatments: preventing epileptogenesis by targeting inflammation. Expert Rev. Neurother. 2013;13(6):615–625. doi: 10.1586/ern.13.54. [DOI] [PMC free article] [PubMed] [Google Scholar]
- England M.J., Liverman C.T., Schultz A.M., Strawbridge L.M., editors. Epilepsy Across the Spectrum: Promoting Health and Understanding. National Academies Press; US: 2012. [DOI] [PubMed] [Google Scholar]
- Ford E.S., Mokdad A.H. Dietary magnesium intake in a national sample of US adults. J. Nutr. 2003;133(9):2879–2882. doi: 10.1093/jn/133.9.2879. [DOI] [PubMed] [Google Scholar]
- Joshi C., Stillman C., Criteser S., Oliver J., Conley A., Sillau S., et al. Yield of laboratory testing in pediatric ketogenic diet patients: critical assessment of abnormal results and impact on clinical care. Epilepsy Res. 2019;149:70–75. doi: 10.1016/j.eplepsyres.2018.11.007. [DOI] [PubMed] [Google Scholar]
- Kaner G., Yurtdaş Depboylu G., Çalık G., Alaca G., Olgaç Dündar N. Nutritional status and adherence to the mediterranean diet in children with epilepsy. Clin. Nutr. ESPEN. 2022;48:259–266. doi: 10.1016/j.clnesp.2022.02.003. [DOI] [PubMed] [Google Scholar]
- Kaplin A.I., Williams M. How common are the "common" neurologic disorders? Neurology. 2007;69(4):410–411. doi: 10.1212/01.wnl.0000278071.91524.4d. [DOI] [PubMed] [Google Scholar]
- Kirkland A.E., Sarlo G.L., Holton K.F. The role of magnesium in neurological disorders. Nutrients. 2018;10(6):730. doi: 10.3390/nu10060730. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kwan P., Brodie M.J. Early identification of refractory epilepsy. N. Engl. J. Med. 2000;342(5):314–319. doi: 10.1056/NEJM200002033420503. [DOI] [PubMed] [Google Scholar]
- Liu Y., Hu G., Zhang M., Lin J. Association between dietary carbohydrate intake percentage and epilepsy prevalence in the NHANES 2013-2018: a cross-sectional study. Nutr. Neurosci. 2024;27(11):1321–1329. doi: 10.1080/1028415X.2024.2329481. [DOI] [PubMed] [Google Scholar]
- Mauskop A., Altura B.M. Role of magnesium in the pathogenesis and treatment of migraines. Clin. Neurosci. 1998;5(1):24–27. [PubMed] [Google Scholar]
- Mazur A., Maier J.A., Rock E., Gueux E., Nowacki W., Rayssiguier Y. Magnesium and the inflammatory response: potential physiopathological implications. Arch. Biochem. Biophys. 2007;458(1):48–56. doi: 10.1016/j.abb.2006.03.031. [DOI] [PubMed] [Google Scholar]
- McDonald J.W., Silverstein F.S., Johnston M.V. Magnesium reduces N-methyl-D-aspartate (NMDA)-mediated brain injury in perinatal rats. Neurosci. Lett. 1990;109(1-2):234–238. doi: 10.1016/0304-3940(90)90569-u. [DOI] [PubMed] [Google Scholar]
- Mercer B.M., Merlino A.A. Society for maternal-fetal medicine. Magnesium sulfate for preterm labor and preterm birth. Obstet. Gynecol. 2009;114(3):650–668. doi: 10.1097/AOG.0b013e3181b48336. [DOI] [PubMed] [Google Scholar]
- National Center for Health Statistics NHANES Questionnaires, Datasets, and Related Documentation. CDC. 2023 [Google Scholar]
- Nielsen F.H. Magnesium, inflammation, and obesity in chronic disease. Nutr. Rev. 2010;68(6):333–340. doi: 10.1111/j.1753-4887.2010.00293.x. [DOI] [PubMed] [Google Scholar]
- Prentice R.L., Mossavar-Rahmani Y., Huang Y., Van Horn L., Beresford S.A., Caan B., et al. Evaluation and comparison of food records, recalls, and frequencies for energy and protein assessment by using recovery biomarkers. Am. J. Epidemiol. 2011;174(5):591–603. doi: 10.1093/aje/kwr140. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Prudencio M.B., de Lima P.A., Murakami D.K., Sampaio L.P.B., Damasceno N.R.T. Micronutrient supplementation needs more attention in patients with refractory epilepsy under ketogenic diet treatment. Nutrition. 2021;86 doi: 10.1016/j.nut.2021.111158. [DOI] [PubMed] [Google Scholar]
- Rosanoff A., Weaver C.M., Rude R.K. Suboptimal magnesium status in the United States: are the health consequences underestimated? Nutr. Rev. 2012;70(3):153–164. doi: 10.1111/j.1753-4887.2011.00465.x. [DOI] [PubMed] [Google Scholar]
- Slutsky I., Sadeghpour S., Li B., Liu G. Enhancement of synaptic plasticity through chronically reduced Ca2+ flux during uncorrelated activity. Neuron. 2004;44(5):835–849. doi: 10.1016/j.neuron.2004.11.013. [DOI] [PubMed] [Google Scholar]
- smail R.S., Kishk N.A., Rizk H.I., El-Kholy T., Abd El-Maoula L.M., Ibrahim El-Desoky O., et al. Nutritional intake and its impact on patients with epilepsy: an analytical cross-sectional study. Nutr. Neurosci. 2022;25(9):1813–1822. doi: 10.1080/1028415X.2021.1905371. [DOI] [PubMed] [Google Scholar]
- Subar A.F., Kipnis V., Troiano R.P., Midthune D., Schoeller D.A., Bingham S., et al. Using intake biomarkers to evaluate the extent of dietary misreporting in a large sample of adults: the OPEN study. Am. J. Epidemiol. 2003;158(1):1–13. doi: 10.1093/aje/kwg092. [DOI] [PubMed] [Google Scholar]
- Valeri L., Vanderweele T.J. Mediation analysis allowing for exposure-mediator interactions and causal interpretation: theoretical assumptions and implementation with SAS and SPSS macros. Psychol. Methods. 2013;18(2):137–150. doi: 10.1037/a0031034. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Verrotti A., Agostinelli S., Coppola G., Parisi P., Chiarelli F. A 12-month longitudinal study of calcium metabolism and bone turnover during valproate monotherapy. Eur. J. Neurol. 2010;17(2):232–237. doi: 10.1111/j.1468-1331.2009.02773.x. [DOI] [PubMed] [Google Scholar]
- Vezzani A., French J., Bartfai T., Baram T.Z. The role of inflammation in epilepsy. Nat. Rev. Neurol. 2011;7(1):31–40. doi: 10.1038/nrneurol.2010.178. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Vezzani A., Lang B., Aronica E. Immunity and Inflammation in Epilepsy. Cold Spring Harb. Perspect. Med. 2015;6(2):a022699. doi: 10.1101/cshperspect.a022699. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Volpe S.L., Schall J.I., Gallagher P.R., Stallings V.A., Bergqvist A.G. Nutrient intake of children with intractable epilepsy compared with healthy children. J. Am. Diet. Assoc. 2007;107(6):1014–1018. doi: 10.1016/j.jada.2007.03.011. [DOI] [PubMed] [Google Scholar]
- Wright M.E., Mayne S.T., Swanson C.A., Sinha R., Alavanja M.C. Dietary carotenoids, vegetables, and lung cancer risk in women: the Missouri women's health study (United States) Cancer Causes Control. 2003;14(1):85–96. doi: 10.1023/a:1022565601937. [DOI] [PubMed] [Google Scholar]
- Yary T., Kauhanen J. Dietary intake of magnesium and the risk of epilepsy in middle-aged and older Finnish men: a 22-year follow-up study in a general population. Nutrition. 2019;58:36–39. doi: 10.1016/j.nut.2018.06.019. [DOI] [PubMed] [Google Scholar]
- Yuen A.W., Sander J.W. Can magnesium supplementation reduce seizures in people with epilepsy? A hypothesis. Epilepsy Res. 2012;100(1-2):152–156. doi: 10.1016/j.eplepsyres.2012.02.004. [DOI] [PubMed] [Google Scholar]
- Zack M.M., Kobau R. National and State Estimates of the Numbers of Adults and Children with Active Epilepsy - United States, 2015. MMWR Morb. Mortal. Wkly Rep. 2017;66(31):821–825. doi: 10.15585/mmwr.mm6631a1. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Zhang Y., Shen J., Su H., Lin C. Association between composite dietary antioxidant index and epilepsy in American population: a cross-sectional study from NHANES. BMC Public Health. 2024;24(1):2240. doi: 10.1186/s12889-024-19794-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Supplementary material
Data Availability Statement
The datasets generated and/or analyzed during the current study are publicly available from the National Center for Health Statistics NHANES website: [https://www.cdc.gov/nchs/nhanes/about/index.html].




