With the improvement of people's living conditions and changes in social lifestyles, the incidence of type 2 diabetes is gradually increasing, and the number of people with diabetes and cardiovascular disease is also increasing. Based on this, the article collects basic information on 650 elderly patients with type 2 diabetes, of which 49.39% are between 60 and 70 years old, 32.46% are between 70 and 80 years old, and 18.15% are between 80 and 90 years old. Through the analysis of related cardiovascular disease risk factors, the correlation between the elderly cardiovascular disease risk factors and type 2 diabetes is explored. The results showed that the correlations between smoking history, diastolic blood pressure, total cholesterol, low-density lipoprotein cholesterol, and the risk of type 2 diabetes in the elderly were 0.987, 0.956, 0.971, and 0.940, respectively. It can be seen that these factors are highly correlated with the risk of type 2 diabetes in the elderly, and smoking history has the strongest correlation, indicating that high levels of smoking may be a key pathogenic factor in the onset of type 2 diabetes. The correlation of other factors is lower than 0.8, indicating that other factors are additional risk factors for the disease. After that, the p value was 0.01, and the difference test was passed, which proved the accuracy of the model.