The competing risk method has become more acceptable for time-to-event data analysis because of its advantage over the standard Cox model in accounting for competing events in the risk set. This study aimed to construct a prediction model for diabetes using a subdistribution hazards model.We prospectively followed 1857 community residents who were aged ≥ 55 years, free of diabetes at baseline examination from August 1992 to December 2012. Diabetes was defined as a self-reported history of diabetes diagnosis, taking antidiabetic medicine, or having fasting plasma glucose (FPG) ≥ 7.0 mmol/L. A questionnaire was used to measure diabetes risk factors, including dietary habits, lifestyle, psychological factors, cognitive function, and physical condition. Gray test and a subdistribution hazards model were used to construct a prediction algorithm for 20-year risk of diabetes. Receiver operating characteristic (ROC) curves, bootstrap cross-validated Wolber concordance index (C-index) statistics, and calibration plots were used to assess model performance.During the 20-year follow-up period, 144 cases were documented for diabetes incidence with a median follow-up of 10.9 years (interquartile range: 8.0-15.3 years). The cumulative incidence function of 20-year diabetes incidence was 11.60% after adjusting for the competing risk of nondiabetes death. Gray test showed that body mass index, FPG, self-rated heath status, and physical activity were associated with the cumulative incidence function of diabetes after adjusting for age. Finally, 5 standard risk factors (poor self-rated health status [subdistribution hazard ratio (SHR) = 1.73, P = 0.005], less physical activity [SHR = 1.39, P = 0.047], 55-65 years old [SHR = 4.37, P < 0.001], overweight [SHR = 2.15, P < 0.001] or obesity [SHR = 1.96, P = 0.003], and impaired fasting glucose [IFG] [SHR = 1.99, P < 0.001]) were significantly associated with incident diabetes. Model performance was moderate to excellent, as indicated by its bootstrap cross-validated discrimination C-index (0.74, 95% CI: 0.70-0.79) and calibration plot.Poor self-rated health, physical inactivity, being 55 to 65 years of age, overweight/obesity, and IFG were significant predictors of incident diabetes. Early prevention with a goal of achieving optimal levels of all risk factors should become a key element of diabetes prevention.