All study populations were restricted to individuals without diabetes in the three Swedish cohorts detailed below. We defined diabetes according to the ADA and WHO criteria: fasting plasma glucose concentrations ≥7.0 mmol/l and/or self-reported diabetes with or without treatment with oral hypoglycaemic agents or insulin.
The Swedish Mammography Cohort (SMC) was established during 1987–1990. Between November 2003 and October 2009, a randomly selected sub-cohort (SMCC) of 5022 women living in the city of Uppsala, Sweden, underwent dual energy x-ray absorptiometry (DXA) measurements, provided morning fasting blood samples, had height and weight measurements taken, and completed a medical and lifestyle questionnaire . Of these, 3945 women had complete information on fasting glucose, diabetes status, genetic data and DXA measurements and were thus included in our analyses. Genotyping in the SMCC was performed using the Illumina GSAMD-24v1-0_20011747_A1 BeadChip, USA and SNPs were imputed up to Haplotype Reference Consortium (HRC) v1.1 and 1000 Genomes project phase 3. The results were then analysed using the software GenomeStudio 2.0.3 from Illumina, USA. The sample success rate was ≥98%. The SMCC is managed by the Swedish Infrastructure for Medical Population-based Life-course and Environmental Research (www.simpler4health.se).
Prospective investigation of the vasculature of Uppsala seniors
Between 2001 and 2004, all 70-year-old residents of Uppsala, Sweden, were invited to participate in a health survey and clinical assessment . Of 2025 invited, 1016 (50.2%) participated in the baseline assessment. From these, 691 participants had complete information on fasting blood glucose (converted to plasma concentrations) , diabetes status, genetic data and DXA measurements and were included in our analyses. Genotyping in the Prospective Investigation of the Vasculature of Uppsala Seniors (PIVUS) was performed using Illumina OmniExpress+Metabochip, USA, quality controlled and imputed up to the HRC panel using the software IMPUTE (https://mathgen.stats.ox.ac.uk/impute/impute_v1_html). The sample success rate was 98.8% and the reproducibility 100% according to duplicate analysis of 2.4% of the genotypes.
In 1970, all men born between 1920 and 1924, living in the county of Uppsala, Sweden, were invited to a take part in a health survey . The men who participated were regularly re-examined, and the current analyses were based on the fifth examination cycle in 2003–2005, when 952 men were invited for examination and 526 of them were examined (mean age 82 years). Of these men, 360 had complete information on fasting glucose, diabetes status, genetic data and DXA measurements and were thus included in our analyses. Genotyping was performed using Illumina Omni2.5+Metabochip and GenomeStudio 2010.3, USA and imputed up to the HRC panel using the software IMPUTE. The sample success rate was ≥99%, minor allele frequency (MAF <5%) or ≥95% (MAF ≥5%).
This study complies with the Declaration of Helsinki. The ethics committee of Uppsala University approved the studies (ethical approval numbers 2010/0148-32 [Stockholm] and 2019-02125 [Uppsala]). All participants provided their informed consent.
Bone area and BMD
Bone area (cm2) and BMD (g/cm2) of the total hip and femoral shaft were measured by DXA (DPX Prodigy, Lunar, Madison, WI, USA). All measurements in all three cohorts were performed on the same DXA machine by the same experienced and accredited DXA x-ray nurse. The hip was set in a standard position by a fixed position of the knee, ankle and foot, to ensure that area did not vary due to rotational differences, and each scan was checked before it was accepted. The total hip area region of interest (ROI) was defined as the total area within the blue lines, corresponding to the femoral neck, Ward’s area, trochanter, and femoral shaft ROIs (Fig. 1) . The ROI was adjusted to the same location for each participant if needed (< 0.5% of scans). The precision error from the DXA was <1% for BMD and bone area at the total hip. To quantify differences in bone area and BMD, we calculated a percentage difference by dividing the β estimate generated from the meta-analysed inverse-variance weighted (IVW) regression models by the mean value of either bone area or BMD multiplied by 100.
As instrumental variables, we selected the 36 SNPs associated with fasting glucose concentrations at a genome-wide significance threshold (p < 5× 10−8) in a population without diabetes of European descent (n = 133,010) from the Meta-Analyses of Glucose and Insulin-related traits Consortium (MAGIC) . One SNP (rs10747083) was associated with fasting glucose in the opposite direction compared with that in MAGIC in all three included Swedish cohorts and was excluded from subsequent analysis as it was not deemed a robust instrument, leaving 35 SNPs as instrumental variables in the present analyses. All 35 SNPs were available in the three cohorts and were independent (linkage disequilibrium R2 < 0.01 in European population).
The MR approach was used to obtain quantitative estimates of the causal effects of fasting glucose on total hip bone area and BMD, based on the assumptions that the genetic variants used as instrumental variables: (1) are associated with the exposure (fasting glucose); (2) are not associated with any confounders of the exposure–outcome association; and (3) are associated with bone area and BMD through the exposure only and not through any alternative causal pathway ensuring a lack of pleiotropy (Fig. 2).
Linear regression models, adjusted for age and genetic principal components (SMCC n = 10, PIVUS n = 2, ULSAM n = 4), were applied to estimate the association between each SNP and bone area and BMD at the total hip. In the primary analysis, the SNP–glucose and SNP–bone outcome β coefficients were used to compute estimates of the associations of fasting glucose with the bone outcomes using the IVW method , first using fixed effects and then with random effects . The MR estimates (β coefficients and standard errors) for the associations between genetically predicted fasting glucose and the outcomes computed from each of the three cohorts were then combined in a meta-analysis using the metan package for Stata (https://raw.github.com/remlapmot/mrrobust/master/).
To explore the robustness of the MR results we conducted analysis using the weighted median, which can provide a consistent estimate of the causal effect even when up to 50% of the genetic variants are invalid instruments . We applied MR-Egger regression  methods using the mrrobust package  to identify and control for bias due to directional pleiotropy. Pleiotropy was evaluated based on the intercept obtained from the MR-Egger analysis . To identify any potential outliers and examine the extent of horizontal pleiotropy, we applied the MR-Pleiotropy RESidual Sum and Outlier (PRESSO) method  using the MR-PRESSO package in R (https://github.com/rondolab/MR-PRESSO).
In sensitivity analyses, we used multivariable MR analysis to adjust for genetically predicted height  and BMI because of the known effects of height and BMI  on bone size and diabetes risk, and also removed SNP (rs7651090, for human gene IGF2BP2) due to the known effects of IGF binding proteins on bone health. We then performed the above main analyses also including those with type 2 diabetes in our cohorts (total n = 4234 in SMCC, 783 in PIVUS, 443 in ULSAM) and using sex-specific β estimates for the associations of the SNPs with fasting glucose (accessed, 20 August 2020 from https://www.magicinvestigators.org/downloads/) and total hip bone area and BMD in our cohorts. A weighted genetic risk score (wGRS) was generated using the 35 SNPs and the β estimates from the MAGIC consortium genome-wide association study data, and we conducted a one-sample MR using the wGRS as the instrumental variable to estimate its association with bone area and BMD using the Wald ratio method (95% CI calculated using the delta method) and additionally with further adjustment for BMI and height. Statistical analyses were performed in Stata MP 15 (StataCorp, College Station, TX, USA) and R, partly using resources provided by SNIC-SENS (a SNIC project with the purpose of providing secure handling of sensitive data [such as human genomic data] to the research community) through the Uppsala Multidisciplinary Center for Advanced Computational Science (UPPMAX). A p value of <0.05 was considered statistically significant.