Mediation analysis was used to evaluate whether the duration of diabetes played a mediating role in the occurrence of AST/ALT ratio and DR. The gene discussed is GPT; the disease is diabetes mellitus.