IntroductionType 2 Diabetes Mellitus (T2DM) is a rising global health concern, heavily influenced by modifiable lifestyle and psychosocial factors. However, most predictive tools focus on biomedical markers and rely on real-time data from wearables or electronic health records, limiting their scalability in resource-constrained settings. This study presents a novel digital twin (DT) framework that uses retrospective lifestyle, behavioral, and psychosocial data to forecast T2DM onset and simulate the estimated effects of preventive interventions.MethodsData were drawn from 19,774 participants in the UK Biobank cohort, followed for up to 17 years. A penalized Cox proportional hazards model was employed to estimate individual time-to-event risk trajectories based on 90 candidate predictors. Predictors were selected through univariate screening, multicollinearity assessment, and variance filtering, yielding a final model with 14 significant variables. Causal inference techniques, including directed acyclic graphs (DAGs) and counterfactual simulations, were used to explore intervention effects on disease progression.ResultsThe model demonstrated strong predictive performance (C-index = 0.90, SD = 0.004). Psychosocial stressors such as loneliness, insomnia, and poor mental health emerged as strong independent predictors and were associated with estimated increases in absolute T2DM risk of approximately 35 percentage points individually and nearly 78 percentage points when combined, under the modeled assumptions. These effects were partly reinforced through diet, with high intake of processed meat, salt, and sugary cereals acting as risk amplifiers within the modeled causal pathways. Cheese intake was protective overall, but its estimated benefit was attenuated under psychosocial stress, where reduced consumption produced a small, directionally harmful mediation effect. Counterfactual simulations suggested that improvements in psychosocial conditions could reduce estimated T2DM risk by approximately 11.6 percentage points within the modeled cohort, with protective dietary patterns such as cheese consumption re-emerging as psychosocial stress was alleviated. The model also revealed pronounced ethnic disparities, with South Asian, African, and Caribbean participants exhibiting significantly higher estimated risk than White counterparts within this cohort. These findings highlight the potential of integrated, stress-informed prevention strategies that address both psychosocial and dietary pathways.ConclusionThis study introduces a transparent, simulation-enabled DT framework for estimating T2DM risk and exploring behavioral intervention scenarios without reliance on real-time data streams. It enables interpretable, personalized prevention planning and supports exploration of scalable deployment in public health, particularly in underserved or low-infrastructure environments. The integration of psychosocial and lifestyle data represents an important step toward more equitable and behaviorally informed digital health solutions.


