Introduction

Pulmonary function refers to the capacity of the respiratory system to facilitate the exchange of gases, a vital process for the proper operation of the respiratory system [1]. It encompasses various aspects, including ventilation, gas exchange, and lung volume function. Spirometry is a commonly employed technique for assessing pulmonary function, yielding measurements such as forced expiratory volume in the first second (FEV1), forced vital capacity (FVC), FEV1/FVC ratio, forced expiratory flow between 25 and 75% of FVC (FEF25-75), and peak expiratory flow rate (PEF) [2]. The identification of any decline in pulmonary function may serve as an indication of the existence of chronic obstructive pulmonary disease (COPD) and asthma [1]. According to the data from the 2019 Global Burden of Disease study, chronic respiratory diseases cause at least 4 million deaths annually, accounting for approximately 7.0% of the global mortality rate [3]. This positioning renders chronic respiratory diseases the third most prevalent cause of death worldwide, trailing behind cardiovascular diseases and tumors [3]. Consequently, it is imperative to ascertain the determinants that can enhance pulmonary function.

Magnesium, the fourth most prevalent mineral in the human body, plays a vital role in DNA and RNA synthesis, cell reproduction, and protein synthesis [4]. Water accounts for approximately 10% of the daily magnesium intake, while chlorophyll is a significant mineral source [5]. The clinical importance of magnesium has garnered considerable attention in recent years, mainly due to its therapeutic efficacy in treating diverse conditions such as eclampsia, pre-eclampsia, cardiac arrhythmia, severe asthma, and migraine headaches [4]. Moreover, research studies have suggested that magnesium supplementing can improve pulmonary function [6,7,8].

Notably, a considerable body of research has investigated the correlation between magnesium and pulmonary disease. Randomized, double-blind, placebo-controlled trials have shown that administering magnesium supplements to individuals with COPD can mitigate pulmonary hyperinflation and augment respiratory muscle strength [9]. The multifaceted nature of magnesium, functioning as both an anti-inflammatory agent and a bronchodilator, assumes a pivotal role in regulating pulmonary function and managing associated ailments [8]. Conversely, inadequate consumption of magnesium may lead to a reduction in pulmonary capacity and circulatory perfusion, ultimately culminating in a deterioration of pulmonary function [10].

However, despite the potential benefits of magnesium on pulmonary function, as evidenced by the studies mentioned above, a matter of disagreement persists. Zanforlini et al. conducted a study demonstrating that oral magnesium supplementation had limited influence on pulmonary function in individuals with COPD despite its potential anti-inflammatory characteristics [11]. Han et al. contended that more extensive investigations were imperative to validate the impacts of magnesium on pulmonary function [12]. To further substantiate the association, we employed data from the NHANES database from 2007 to 2012 to examine the correlation between dietary magnesium intake and pulmonary function. Our approach involved utilizing weighted multivariate linear regression and conducting a range of sensitivity analyses to reinforce the epidemiological basis of our findings.

Materials and Methods

Study Population

The NHANES database, overseen by the Centers for Disease Control and Prevention (CDC), conducts multistage, cross-sectional surveys that provide comprehensive insights into the nutritional and health status of the US population. The data collection process follows a multistage process, collecting data uniformly on a 2-year cycle. The NHANES initiative has obtained ethical clearance from the Ethics Review Committee of the National Health Statistics Research Center, and all participants have provided written, informed consent [13]. Detailed surveys and data from the study can be accessed on the NHANES website at https://www.cdc.gov/nchs/nhanes/. The study was conducted strictly in accordance with the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) guidelines (Supplementary Material 1) [14].

The present cross-sectional study analyzed participant data obtained from the three consecutive NHANES cycles (NHANES, 2007–2008, 2009–2010, and 2011–2012) due to the exclusive collection of pulmonary function data during these specific cycles. Initially, a total of 30,442 participants were enrolled. However, after excluding participants below the age of 20 (n = 12,729), individuals with incomplete data on magnesium intake (n = 1730), those with missing data on pulmonary function and class quality C or lower (n = 14,965), and individuals with missing data on significant covariates (n = 200), our study ultimately comprised a final sample size of 818 subjects (Fig. 1).

Fig. 1
figure 1

Flowchart of the sample selection from the 2007–2012 National Health and Nutrition Examination Survey (NHANES)

Exposure Variable

In our study, the exposure variable under consideration was dietary magnesium intake. The data on nutrient intake for foods and beverages in the NHANES were acquired through two 24-h nutritional recall surveys. These surveys were administered by proficient dietary interviewers employing a dietary data collection tool devised by the US Department of Agriculture. The initial survey took place at the Mobile Examination Center (MEC), while the subsequent survey was conducted via a telephone call within a span of 3–10 days. We computed the mean value of dietary magnesium measurements over 2 days to mitigate potential bias.

Outcome Assessment

Participants who satisfied the minimum age criterion of 6 years were considered eligible to partake in the spirometry segment of the NHANES. However, individuals with acute respiratory illnesses, persistent coughs, tuberculosis patients undergoing tuberculosis medication, recent eye, chest, or abdominal surgery, as well as those who had recently suffered a heart attack or stroke, were deemed ineligible for the spirometry test. For a more comprehensive understanding of the criteria for inclusion and exclusion, further information can be accessed here [15]. The evaluation of FVC and FEV1 was performed utilizing a quality scale encompassing grades A to F. In our research, exclusively individuals with an FEV1 and FVC rating of either A or B were incorporated [16]. We have focused on the following five pulmonary function indices:

  1. 1.

    FVC: This index represents the maximum volume a person can forcefully exhale after taking the deepest possible breath.

  2. 2.

    FEV1: It is the volume of gas that can be exhaled as rapidly and forcefully as possible in a single second, starting from a state of full inhalation.

  3. 3.

    FEV1/FVC: This ratio is a crucial indicator in pulmonary function tests, demonstrating the speed at which gases are expelled from the lungs.

  4. 4.

    FEF25-75%: This measure is determined as the volume of breath exhaled per second during forced expiratory maneuvers when the expiratory volume is between 25 and 75%. It indicates the degree of openness of the small airways within the entire airway system.

  5. 5.

    PEF: This test indicates the maximum speed achieved during expiration and is frequently used to assess obstructive airway disease.

Covariates

We summarized the potential covariates that may confound the correlation between magnesium intake and pulmonary function based on the multivariable adjustment model of previous studies [17]. We included the following demographic variables: gender, age, race, education level, the ratio of family income to poverty (PIR), marital status, body mass index (BMI), alcohol intake, smoking status, hypertension, and diabetes. Criteria for the classification of categorical variables and the determination of complications are detailed in Supplementary Material 2.

Statistical Analysis

The statistical analyses adhered to the guidelines established by the CDC, incorporating sampling strata, clusters, and weights provided by NHANES to ensure the representativeness of the findings for the US population. The intricate multistage cluster sampling design described in the reference was employed [18]. Continuous variables were reported as means ± standard error, whereas categorical variables were expressed as percentages. Group differences were evaluated through weighted analysis of variance (ANOVA) for continuous variables and the chi-square test for categorical variables. To ensure the accuracy of the results, confounding factors were accounted for.

Additionally, three weighted multivariate linear regression models were constructed to investigate the relationship between magnesium intake and pulmonary function. In model 1, no covariates were adjusted. Model 2 was adjusted for gender, age, and race. Model 3 was adjusted for gender, age, race, education level, PIR, marital status, BMI, alcohol intake, smoking status, hypertension, and diabetes. Age, gender, BMI, smoking, hypertension, and diabetes status were performed as subgroup analyses. In addition, we also added the interaction tests to check for potential interaction. Sensitivity analysis was used to verify the robustness of the results. A p-value less than 0.05 was deemed to be statistically significant. The statistical analyses were conducted utilizing R software (version 4.1.2; http://www.R-project.org, R Foundation for Statistical Computing, Vienna, Austria).

Results

Cross‑Sectional Characteristics of the Participants

As shown in Table 1, the participants had an average age of 50.46 ± 0.87 years, with 60.19% male and 39.81% female. Noteworthy pulmonary function parameters included the mean FVC at 4302.88 ± 47.29 mL and the mean FEV1 at an average of 2856.56 ± 32.54 mL. The average FEV1/FVC ratio was 0.66 ± 0.00. Additionally, the reported mean values for FEF25-75% and PEF were 1980.88 ± 41.60 mL/s and 7448.70 ± 96.60 mL/s, respectively. The magnesium tertiles 1–3 ranges were 41.9–433, 434–813, and 814–1193 mg, respectively. Furthermore, we observed a significant increase in FEV1, FVC, FEV1/FVC, PEF, and FEF in participants belonging to tertile 3 compared to those with lower magnesium intake (p < 0.05). In the different tertiles of magnesium intake, we did not observe any significant differences in race, education level, PIR, marital status, BMI, alcohol intake, smoking, hypertension, and diabetes (all p > 0.05).

Table 1 Weighted baseline characteristics of participants

Survey-Weighted Generalized Linear Regression Analysis

Table 2 shows the results of weighted generalized linear regression models adjusted for different covariates to assess the association between magnesium intake and pulmonary function. Overall, each model demonstrated a positive correlation between magnesium intake and pulmonary function. In the fully adjusted model, we observed a significant positive association between magnesium intake and FEV1 (β = 1.02, 95%CI: 0.61–1.38), FVC (β = 1.19, 95%CI: 0.63–1.75), FEF (β = 1.002, 95%CI: 0.62–1.38), and PEF (β = 2.17, 95%CI: 1.02–3.31).

Table 2 Weighted multivariate linear regression models of magnesium intake with pulmonary function

To further assess the association, we converted magnesium from a continuous variable to a categorical variable (tertiles). Its positive correlation remains stable in each model. Notably, the impact of magnesium intake on FEV1/FVC was only found to be a significant effect value once the magnesium tertile transformed. However, after the transformation, a robust positive correlation was observed. In the fully adjusted model (model 3), the β value for the highest tertile (tertile 3) was determined to be 0.024 (95% CI: 0.004, 0.044) in comparison to the lowest tertile (tertile 1).

Subgroup Analysis

We performed two subgroup analyses to evaluate further the robustness of the association between magnesium intake and pulmonary function (Table 3). In the initial phase, we categorized the populations into subgroups according to BMI, hypertension, diabetes, and smoking status and noted that the positive correlations remained consistent. Further interaction tests yielded the following findings: 1. The association between magnesium intake and both FEV1 and FEV1/FVC remained consistent regardless of BMI, hypertension, and diabetes mellitus (p for interaction > 0.05). 2. The association between magnesium intake and FVC was unaffected by hypertension and diabetes mellitus (p for interaction > 0.05). 3. The relationship between magnesium intake and FEF25-75% was observed to be unaffected by smoking status, hypertension, and diabetes mellitus (p for interaction > 0.05). 4. The correlation between magnesium intake and PEF was unaffected by smoking status, hypertension, diabetes, and BMI (p for interaction > 0.05).

Table 3 Subgroup analysis for the association between magnesium intake and pulmonary function

We then assessed whether age or sex influenced the relationship between magnesium and pulmonary function (Supplementary Material 3). The results revealed a consistently strong positive correlation. Specifically, it was observed that the improvement in pulmonary function was more prominent in men than in women with the same magnesium intake. This difference was particularly pronounced in men over the age of 40.

Sensitivity Analysis

Additionally, sensitivity analyses were performed to exclude patients diagnosed with COPD. The specific exclusion criteria can be found in Supplementary Material 4. After eliminating subjects with incomplete data, the study population was reduced to 449. Remarkably, the sensitivity analysis results remained consistent, reinforcing the conclusion that magnesium effectively improves pulmonary function.

Discussion

In this cross-sectional study comprising 818 participants, a robust positive correlation between magnesium and pulmonary function was observed. Subgroup analyses revealed that this association remained consistent across various demographic factors, including gender, age, BMI, hypertension, and diabetes. Moreover, we found stronger associations between magnesium and pulmonary function among males over 40. Additionally, our findings indicated a significant increase in magnesium intake in the second and third quartile groups. Prior research has highlighted that magnesium intake is notably higher in specific US demographics, particularly among young adults, men, and non-Hispanic whites [19]. This difference reveals an important phenomenon: although there is a general trend toward inadequate magnesium intake among US adults [20], magnesium intake varies considerably across subgroups. Thus, the elevated magnesium intake found in our study may reflect the unique dietary patterns of these specific groups. These insights contribute to a more accurate understanding of the relationship between magnesium intake and lung function in different populations.

Over recent years, there has been a growing interest in the relationship between pulmonary function and magnesium. To illustrate, one particular study focusing on trace nutrients’ role in combating pulmonary diseases underscored the protective influence of magnesium on lung function [21]. Despite these findings, the intricate mechanisms underpinning this protective effect remain elusive. In the realm of COPD treatments, it is noteworthy that researchers have pinpointed that inhaling magnesium sulfate can markedly bolster lung function [12]. In support of this, animal studies have further revealed that the intake of magnesium sulfate can amplify the tidal volume in horses afflicted with severe asthma, culminating in a pronounced enhancement in their respiratory function [22]. Segueing from this, subsequent research has illuminated that magnesium intake can hinder the histone deacetylase modification in the transcription of pro-inflammatory cytokines, thus fostering lung health [23]. Delving deeper into the myriad benefits of magnesium, a seminal study orchestrated by Wallace and his cohort probed its instrumental role in mitigating the effects of COVID-19 and augmenting immune resilience [24]. Their compelling findings advocate that judicious magnesium supplementation could be a pivotal linchpin in curbing the disease’s trajectory. Pivoting to COPD, a malady intrinsically tethered to lung function, empirical observations have accentuated that serum magnesium trumps vitamin D in assuaging the symptoms of COPD [25]. Furthermore, when navigating the intricacies of pulmonary hypertension, magnesium has been spotlighted as a potent therapeutic ally [26]. In brief, a holistic appraisal of diverse research trajectories underscores the unparalleled therapeutic prowess of magnesium across a gamut of respiratory afflictions, encompassing asthma and COPD [12, 25]. Distilling these multifaceted insights, the nexus between lung function and magnesium emerges as incontrovertibly beneficial. Given these results, we recommend an increased dietary intake of magnesium, particularly for populations at risk of pulmonary diseases or those exhibiting diminished lung function. This recommendation aligns with current dietary guidelines, which advocate for magnesium-rich foods such as green leafy vegetables, nuts, seeds, and whole grains [5]. Incorporating these foods into daily diets can be a practical and effective strategy for enhancing pulmonary health [27].

The role of magnesium in influencing pulmonary function still needs to be fully elucidated [28]. Nevertheless, research has demonstrated a link between magnesium intake and bronchodilation [29]. This association can be attributed to two primary factors: first, magnesium facilitates the relaxation of bronchial smooth muscles, leading to bronchodilation [30]; second, it possesses inherent anti-inflammatory properties [11]. Specifically, inflammation is a prevalent issue in conditions like COPD or asthma, where lung functionality is diminished [11, 31]. Given its anti-inflammatory attributes, magnesium is vital in counteracting bronchospasms in these conditions, leading to enhanced FEV1 readings and improved pulmonary function. Moreover, magnesium and calcium exhibit a dynamic interplay within human physiology [32]. A surge in intracellular calcium ion levels can trigger the contraction of bronchial smooth muscles [28]. Yet, by augmenting magnesium consumption, the balance between calcium and magnesium is recalibrated. This might deter calcium from infiltrating vascular endothelial cells, diminishing bronchial smooth muscle contractions and bolstering lung performance [30]. Emphasizing the significance of gas exchange is a paramount criterion for assessing pulmonary health. Magnesium, acting as a distinct antagonists to calcium channels in vascular smooth muscles, induces vasodilation, enhancing blood circulation [33]. Considering the direct relationship between gas exchange and blood flow, magnesium amplifies gas exchange efficiency, thus fortifying pulmonary function [34]. Furthermore, magnesium holds a pivotal position within the hematopoietic framework. They bolster the activity of hypoxia-inducible factors, elevate erythropoietin concentrations, and foster red blood cell growth. This mechanism enhances the oxygen-carrying capacity of the lungs, culminating in a boost in pulmonary performance [35].

Subgroup analysis indicates that men over 40 may constitute a distinct demographic experiencing more significant improvements in pulmonary function [36]. Despite these observations, the precise mechanisms responsible for this pronounced benefit in this age group remain to be elucidated. Building on this, we postulate that several intertwined mechanisms contribute to the heightened benefits observed in this demographic. First and foremost, magnesium can prevent calcium ions from entering cells via voltage-dependent calcium channels [37]. This action, in turn, facilitates the relaxation of bronchial smooth muscles. As age progresses, especially in men over 40, susceptibility to airway diseases increases [36]. Such conditions often culminate in airway remodeling, characterized by an augmented number of bronchial smooth muscles, increased tension, and constricted airways [38]. In the context of these physiological changes, the bronchial-relaxing effects of magnesium become even more essential [30]. Beyond this, the role of magnesium in preserving cell membrane stability is paramount [39]. Its function is not limited to inhibiting the generation of oxygen-free radicals; it also actively thwarts mast cell degranulation [40]. As the aging process continues, oxidative damage accumulates at a faster pace, making cells more vulnerable [41]. Recognizing this challenge, magnesium acts as a protective shield, effectively reducing cellular damage and fostering improved lung function. Lastly, the influence of magnesium on the immune system is undeniable [42]. Contemporary studies highlight that magnesium can effectively curtail phagocytosis and mitigate the onset of oxidative stress [43]. Supporting this, animal research indicates that a magnesium deficiency might adversely impact T-cell populations [42]. Given the potential decline in immune functionality observed in men over 40, magnesium supplementation is a compelling argument, as it can potentially enhance the immune response and further optimize pulmonary function.

This article presents several notable strengths. Firstly, while existing research has delved into the association between dietary magnesium intake and lung diseases, there has been no comprehensive examination of the link between dietary magnesium intake and five crucial lung function indicators (FEV1, FVC, FEV1/FVC, FEF25-75, PEF) across a substantial sample size. At the same time, our study utilized a nationally representative, extensive cross-sectional dataset from the USA, covering three distinct cycles. It also incorporated weighting mechanisms to accurately represent the correlation between magnesium intake and lung function in the entire US population. Furthermore, we meticulously incorporated sampling weights in all our analyses, ensuring that our findings are representative and generalizable across the USA. Additionally, by adjusting for a plethora of potential confounders based on previous studies and clinical insights, we have enhanced the credibility and accuracy of our results. On the flip side, there are some limitations to consider. The NHANES study, being cross-sectional in nature, captures exposure and pulmonary function data at a singular time point, limiting our ability to infer causality between magnesium intake and pulmonary function. Moreover, even with our comprehensive adjustments for potential covariates, we cannot completely negate the possibility of other unaccounted or residual confounding influences. Finally, as our study focuses solely on the US demographic, extrapolating our conclusions to other international communities requires caution.

Conclusions

In conclusion, our findings suggested that regular magnesium intake can positively influence pulmonary function, with this effect being especially noticeable in men over 40 years of age. Given that many individuals consume magnesium-rich foods in their daily diets, further prospective studies are needed to validate the associations we observed in our research.