Introduction
Coffee is one of the world’s most popular beverages and one of the main sources of caffeine.(Reference Cappelletti, Piacentino and Sani1) Coffee has antioxidant and anti-inflammatory properties, regulates dopaminergic transmission, promotes the release of serotonin, and contains a variety of bioactive compounds, such as chlorogenic acid, catechins, magnesium, lignan, and fenugreek, among other substances.(Reference Heaney2) Previous studies have found a correlation between coffee and a variety of diseases; for example, coffee intake is protective against CVD and depression(Reference Ding, Bhupathiraju and Satija3,Reference Grosso, Micek and Castellano4) but is a risk factor for diseases such as respiratory disease and diabetes,(Reference Alfaro, Monteiro and Cunha5,Reference Bae6) while its effect on bone mineral density (BMD) is not yet clear. BMD is an important indicator of bone strength that is usually measured by dual-energy X-ray absorptiometry, which directly reflects the degree of osteoporosis.(Reference Fuggle, Curtis and Ward7) Femoral neck bone mineral density (FNBMD) is a major risk factor for femoral head fracture, which in turn predisposes to functional impairment and femoral head ischaemia.(Reference Chu, Cheng and Yu8) Additionally, Looker et al. found a correlation between hip fracture incidence and femoral neck bone density.(Reference Looker, Melton and Borrud9) While early studies were equivocal about the effect of coffee intake on BMD, Tanski et al. found coffee intake to be a risk factor for BMD,(Reference Tański, Kosiorowska and Szymańska-Chabowska10) Chua et al. found coffee intake to be a protective factor for BMD,(Reference Chau, Au and Li11) while some other studies found no association between coffee intake and BMD. As a result, the relationship between coffee intake and FNBMD varies widely. The National Health and Nutrition Examination Survey (NHANES) is a cross-sectional survey conducted every 2 years since 1999 by the Centers for Disease Control and Prevention, to collect information on the health and nutritional status of the general population in the United States.(Reference Wang, Seo and Park12) The database contains a variety of data types, including demographic data, laboratory data, interview data, and restricted category data, as well as a stratified multi-stage sampling design that provides a better representation of the general US population.(Reference Moon13,Reference Hartwell, Khojasteh and Wetherill14) Mendelian randomisation (MR) is a statistical method that uses genetic variation as an instrumental variable, in which parental alleles are randomly assigned to offspring according to Mendelian inheritance laws, equivalent to random grouping in a randomised controlled trial.(Reference Skrivankova, Richmond and Woolf15) The instrumental variables used in MR studies are usually SNPs, which are reliably associated with exposure, do not vary with associated lifestyle or socio-economic factors, satisfy temporal sequential plausibility, and yield results with higher strength of evidence than observational studies and randomised controlled trials, on which they have been widely used in recent years to study causal associations in a variety of diseases.(Reference Yuan, Carter and Mason16,Reference Funck-Brentano, Nethander and Movérare-Skrtic17) Thus, our study first explored the correlation between coffee intake and FNBMD using the NHANES database and further analysed the causality between the two using MR.
Methods
Study population in NHANES
In the observational study, we used data from NHANES 2005–2020 since these six cycles (2005–2006, 2007–2008, 2009–2010, 2013–2014, 2017–2018, and 2019–2020, respectively), specifically inquired information about FNBMD. FNBMD measurement using dual-energy X-ray (DXA) absorptiometry. Beginning in 2005, DXA scans have been administered in the NHANES mobile examination centre. Please see the NHANES database for details of the populations that can be measured (https://wwwn.cdc.gov/Nchs/Nhanes/2005-2006/DXXFEM_D.htm#DXXNKBMD).
Coffee intake in NHANES
The collected 24-h dietary recall data in the survey cycle were used to estimate the caffeine intake in this study. For coffee intake data from codes beginning with ‘921’, we would use the average coffee consumption from two 24-h recalls. Combined with previous research, coffee intake was transformed into 6-ounce servings and categorised based on the number of cups consumed. At the same time, the cups/day are divided into five groups: no intake, <1, 1–<2, 2–<4, and 4+ cups/day.(Reference Wang, Jian and Yuan18)
Covariates used in NHANES
Based on previous studies, covariates that may confound the association between coffee intake and FNBMD were collected.(Reference Bourne, Plinke and Hooker19–Reference Strozyk, Gress and Breitling21) The covariates of classified variables were sex (female, male), race/ethnicity (white, Mexican, black, other), education (under high school, high school or equivalent, above high school), marital status (married, living with partner, separated, divorced, widowed, never married), hypertension (no, yes), diabetes (no, yes), smoking (never, former, now), alcohol intake (never, former, heavy, mild, moderate), cancer (no, yes), and prednisone or cortisone (no, yes). The covariates of continuous variables were age (years), BMI (kg/m^2), total calcium (mg), poverty, physical activity (MET), and vitamin D (mg).
Sources of MR
The MR study used two-sample MR. The exposure factor was coffee intake data from Ben Elsworth et al. sequenced in 2018, numbered ukb-b-5237, from the MRC-IEU Consortium, containing 428 860 sample sizes and 985 1867 SNPs. The outcome factor is the FNBMD data sequenced by Zheng et al. in 2015, number ieu-a-980, from the GEFOS Consortium, containing 32 735 sample sizes and 10 586 900 SNPs.(Reference Zheng, Forgetta and Hsu22)
Statistical analyses
The NHANES data analysis refers to the NHANES statistical tutorial and follows its complex multi-stage probability sampling, weighting the sample. The weights were adjusted according to the method provided on the official NHANES website—the weighting variable was chosen as ‘wtdr2d’ and calculated as ‘1/6 * wtdr2d’. All analyses were performed under complex weighting. The continuous data were described using the mean and standard deviation (SD) and analysed using a t-test for statistical inference; the count data were described using the rate and compared with the chi-square test. Weight linear regression was used to explore the association between coffee intake with FNBMD. All covariates used the lowest quartile as the reference. Model 1 was a simple linear regression with coffee intake as the independent variable and FNBMD as the dependent variable. Model 2 was adjusted for age, sex, and race/ethnicity. Model 3 was further adjusted for all the covariates.
To explore the causal relationship between coffee intake and FNBMD, a two-sample MR approach was used. MR analysis was subject to three hypotheses: (1) instrumental variables for coffee intake were strongly associated with FNBMD; (2) instrumental variables for coffee intake were not associated with FNBMD; and (3) instrumental variables for coffee intake were not associated with confounders. SNPs with genome-wide significance that were independent of and strongly associated with coffee intake and FNBMD were selected as instrumental variables, an overview of the study design is shown in Fig. 1. The genome-wide significance parameter for coffee intake was set to P < 5×10–8, the linkage disequilibrium parameter (r2) was set to 0.001, and the genetic distance was set to 10 MB, to screen out instrumental variables with no linkage effect. The association between coffee intake and FNBMD was assessed using mainly an inverse variance weighting (IVW) method. However, the MR-Egger, WM, simple mode, and weighted mode methods were also used as supplementary methods. The method’s theory was described in previous studies. Heterogeneity was examined using the IVW and MR-Egger methods. Sensitivity analysis was performed using the leave-one-out method. Pleiotropy analysis was performed using the egger_intercept method. Finally, the strength of the association of the genetic instruments for each putative risk factor was quantified by the F statistic (F = β2/se2) for all SNPs, to assess the power of the SNPs.(Reference Xie, Huang and Liu23)

Figure 1. Study design overview. NHANES, National Health and Nutrition Examination Survey; FNBMD, femoral neck bone mineral density.
All statistical analyses were carried out using R (4.1.2) software, the ‘nhanesR’ package for NHANES data analysis, and the ‘TwoSampleMR’ package for MR analysis.
Results
Coffee intake and FNBMD in NHANES
There were 66 023 cases in the six cycles, of which 34 838 cases had FNBMD data, and a total of 57 290 cases had coffee data. After combining all covariates and excluding cases with missing values, there were 9 371 cases left. Finally, after excluding individuals younger than 50 years of age, there were a total of 5 915 cases, of which 3 178 were males and 2 737 were females. Weighted to represent 46 001 583 people, including 23 305 670 males and 22 695 913 females, the process is illustrated in Fig. 1.
The groups were formed by differences in intake of cups of coffee and analysed by gender in subgroups. In the overall population, there were differences between sex, BMI, race/ethnicity, marital status, poverty, smoking, alcohol intake, FNBMD, and physical activity; in the female population, there were differences between race/ethnicity, marital status, poverty, smoking, and alcohol intake, and in the male population, there were differences between race/ethnicity, marital status, poverty, smoking, cancer, and physical activity. Detailed results are shown in Tables 1–3.
Table 1. Weighted selected characteristics of study population in female and male, NHANES (weighted N = 46 001 583)

NHANES, National Health and Nutrition Examination Survey; SD, standard deviation; FNBMD, femoral neck bone mineral density.
Table 2. Weighted selected characteristics of study population in female, NHANES (weighted N = 22 695 913)

NHANES, National Health and Nutrition Examination Survey; SD, standard deviation; FNBMD, femoral neck bone mineral density.
Table 3. Weighted selected characteristics of study population in male, NHANES (weighted N = 23 305 670)

NHANES, National Health and Nutrition Examination Survey; SD, standard deviation; FNBMD, femoral neck bone mineral density.
With no intake as a reference, univariate and multivariate linear regression showed that there was no significant difference in the overall population. Multifactorial linear regression showed that for ‘< 1’, ‘1–<2’, ‘2–<4’, and ‘4+’, the OR (95% CI) was 0.02 (–0.01, 0.04), 0.00 (–0.01, 0.02), –0.01 (–0.02, 0.00), and 0.00 (–0.01, 0.02), respectively. Both univariate and multivariate linear regression showed that there was no significant difference in the female population, and multifactorial linear regression showed that for ‘< 1’, ‘1–<2’, ‘2–<4’, and ‘4+’, the OR (95% CI) was 0.02 (–0.01, 0.05), 0.01 (0.00, 0.03), –0.01 (–0.03, 0.01), and 0.02 (0.00, 0.04), respectively. The male population showed no statistically significant differences in both univariate and multivariate linear regressions, and multifactorial linear regression showed that for ‘< 1’, ‘1–<2’, ‘2–<4’, and ‘4+’, the OR (95% CI) was 0.02 (–0.02, 0.05), –0.01 (–0.04, 0.01), 0.00 (–0.02, 0.01), and –0.01 (–0.03, 0.01), respectively. Detailed results are shown in Table 4.
Table 4. Linear regression of femoral neck bone mineral density risk across coffee consumption categories

Model 1 was a simple linear regression with coffee intake as the independent variable and femoral neck bone mineral density as the dependent variable. Model 2 was adjusted for age, sex, and race/ethnicity. Model 3 was further adjusted for all the covariates.
Causal association between coffee intake and FNBMD in MR
Coffee intake was screened to include a total of thirty-three SNPs as instrumental variables. The results of MR showed consistent directions of analysis for the IVW, MR-Egger, WM, simple mode, and weighted mode methods, with the IVW results showing an OR (95% CI) of 1.06 (0.88–1.27), a P-value of 0.55, and an overall F-value of 80.31. The heterogeneity test showed a P-value of 0.62 for the IVW method and 0.57 for the MR-Egger method, revealing no heterogeneity. Sensitivity analysis showed no SNPs with a significant effect on the causal association estimates in the leave-one-out method. The results of the pleiotropy analysis showed a P-value of 0.76 for FNBMD, so there was no case of horizontal pleiotropy. Details are shown in Table 5 and Fig. 2.
Table 5. Mendelian randomisation estimates for the association between coffee intake and Femoral neck bone mineral density


Fig. 2. (A) Scatter plots, (B) funnel plot, and (C) forest map. MR, Mendelian randomisation.
Discussion
Our study first investigated the correlation between coffee intake and FNBMD using the NHANES database with six cycles (2005–2006, 2007–2008, 2009–2010, 2013–2014, 2017–2018, and 2019–2020) weighted by a total of 46 001 583 cases. In both the overall population and the female group, simple linear regression results showed a correlation between 2–<4 cups of coffee intake and FNBMD, but no correlation was found between coffee intake and FNBMD after adjusting for covariates (models 2 and 3). In the male group, both simple linear regression and multiple linear regression results showed no correlation between the two. Further applying a two-sample MR method with coffee intake data from the MRC-IEU Consortium and FNBMD data from the GEFOS Consortium, the IVW results showed an OR (95% CI) of 1.06 (0.88–1.27), and the results of the heterogeneity test, sensitivity analysis, and pleiotropy analysis showed no statistical differences, indicating that no causal relationship was found between coffee intake and FNBMD at the overall population level.
In previous studies, there was a large disagreement between coffee intake and BMD. In animal studies, Tsuang et al. found that caffeine had potentially harmful effects on osteoblast activity and could increase the rate of apoptosis in osteoblasts.(Reference Tsuang, Sun and Chen24) Aparecida et al. found that coffee/caffeine intake had severe adverse effects on calcium metabolism in rats, resulting in elevated urinary and plasma calcium levels, which in turn reduced BMD.(Reference Alfaro, Monteiro and Cunha5) In a small sample of clinical studies, Feng et al. found that reducing coffee intake reduced the risk of osteoporosis(Reference Feng, Wang and Huang25); Franca et al. found that over-caffeinated beverages may have a negative impact on BMD.(Reference De França, Camargo and Lazaretti-Castro26) In studies with large clinical samples, Choi et al. used Korean national data to find a trend towards increased age- and weight-adjusted BMD in the femoral neck, with increasing coffee intake,(Reference Choi, Choi and Park27) and a study from the Hong Kong Osteoporosis Study found a correlation between the presence of coffee-related serum metabolites and lower BMD in the femoral neck, over a 10-year period.(Reference Berman, Honig and Cronstein28) However, in the present study, using data from a large clinical sample, there was no correlation between different levels of coffee intake and FNBMD after adjusting for covariates, either in the overall population or the female or male populations separately, in contrast to the findings of the aforementioned studies. Meanwhile, Lloyd et al. found no association between coffee intake and FNBMD or between coffee intake and longitudinal changes in FNBMD,(Reference Looker, Melton and Borrud9) and Wetmore et al. found no effect of coffee consumption on BMD in young women.(Reference Wetmore, Ichikawa and LaCroix29) The Framingham study, a long-term, prospective observational study, found that the association between coffee intake and hip fracture risk remained indirect(Reference Kiel, Felson and Hannan30); Massey et al. found that the relationship between coffee intake and low BMD became less significant after adjusting for some of the covariates.(Reference Massey31) Since coffee intake is usually confounded by more factors, a causal relationship could not be directly demonstrated, either with or without correlation. Therefore, our study combined a cross-sectional study with MR, which effectively circumvented the confounding of the results. The IVW results showed an OR (95% CI) of 1.06 (0.88–1.27) and a P-value of 0.55, demonstrating that there was no causal relationship between coffee intake and FNBMD. In contrast to the previous study in which Yuan et al. only used MR to explore the causal relationship between coffee intake and FNBMD,(Reference Yuan, Michaëlsson and Wan32) we first used cross-sectional large data for analysis, constructed models with different covariates at different gender levels, and used MR to further explore the causal relationship between the two. The results were validated in terms of correlation and causality, making them more robust.
Although the relationship between coffee intake and FNBMD is unclear, there are several possible scenarios. Coffee is a purine compound that affects osteoblast and osteoclast expression primarily through competitive inhibition of A2A and A2B receptors; its effect on BMD depends on its relative ability to block both receptors and the relative importance of the signalling pathways affected and may not directly affect changes in BMD.(Reference Berman, Honig and Cronstein28) At the organismal level, coffee intake is mainly related to the efficiency of calcium absorption and excretion, resulting in increased urinary calcium excretion and increased blood calcium concentrations, but studies have shown that the increased urinary calcium excretion and increased blood calcium concentrations can also be counteracted by other substances consumed by the body, with no effect on BMD.(Reference Heaney2) At the coffee level, because there are more types of coffee, different coffee types and roasting levels lead to different chemical levels of coffee, which affect the final biopharmacological differences.(Reference Wang, Jian and Yuan18)
However, our study still has some limitations: it was not possible to analyse different types of coffee to explore the effect of different types of coffee on the FNBMD, due to the limitations of the NHANES data source. Previous studies have found inconsistent effects of coffee intake on BMD in young, premenopausal, and menopausal women, but this study could not be analysed for that situation. Coffee intake in the NHANES database was collected on a patient-reported basis and may be affected by memory bias. Although the MR method was used in this study to investigate the causal relationship between the two, MR presupposes the direct existence of a linear relationship between the two, and if it does not exist, then MR is not applicable. BMD changes are a slow, cumulative process, and cross-sectional studies are subject to a variety of confounding factors that require more consideration.
Conclusion
In summary, this study used cross-sectional studies and MR to demonstrate that there is no correlation or causal relationship between coffee intake and FNBMD, but prospective studies are still needed for confirmation.
Data availability statement
The data used in this study were publicly available.
Acknowledgements
We thank the NHANES database, MRC-IEU Consortium, and FNBMD data from the GEFOS Consortium for providing statistics data for the analyses. We thank Zhang Jing (Shanghai Tongren Hospital) for his work on the NHANES database. His outstanding work, nhanesR package and webpage, makes it easier for us to explore the NHANES database.
Funding
None.
Competing interests
Guoxin Huang, Jianzhou Tian, Beibei Zhang, Yifei Liao, Gaojing Qu, and Bin Pei declare that they have no conflict of interest.
Ethical approval
Informed consent was obtained from all subjects in the original genome-wide association studies and NHANES.
Contribution statement
B.P. and D.Q. designed the study. G.H. and Y.L. analysed and interpreted the data. K.W. and B.Z. revised the manuscript. The manuscript was drafted by G.H. with contributions from B.P. B.P. is the guarantor of this work. All authors revised the paper critically for intellectual content and approved the final version. All authors agree to be accountable for the work and to ensure that any questions relating to the accuracy and integrity of the paper are investigated and properly resolved.