Type 2 diabetes mellitus was associated with the decrease of total testosterone (β: -0.021,95%CI: -0.032, -0.010, p<0.001) and sex hormone binding globulin (β: -0.048,95%CI: -0.065, -0.031, p<0.001). The gene discussed is SHBG; the disease is type 2 diabetes mellitus.