While the effect of phosphate on PTH, and in result MS, is partly mediated through calcium, the effect of magnesium on MS is mediated through both PTH and T2DM. Here, PTH is linked to type 2 diabetes mellitus.