Each simulated person accumulates an annual hazard of a major cardiometabolic event (heart disease, stroke, type-2 diabetes). The baseline hazard rises with age (Gompertz form), then is scaled by a combined relative-risk (RR) multiplier built from your four sliders:
h0(age) = 0.0025 · e^(0.055·(age−40))
RR_diet = e^(−0.006·(diet−50))
RR_active = e^(−0.00035·(activity−500))
RR_smoke = 1.0 (never) · 1.3 (former) · 2.5 (current)
RR_sleep = e^(−0.004·(sleep−50))
h(age) = h0(age) · RR_diet · RR_active · RR_smoke · RR_sleep
S(age) = exp(−Σ h(a)), a = 40…age (survival probability)
- Survival curve — the solid line traces S(age) for your current settings against a dashed high-risk and low-risk reference. Cardio-metabolic event-free probability is on the vertical axis.
- 10-year risk — 1 − S(60)/S(50), the standard clinical framing (e.g. Framingham/ASCVD-style 10-year risk) evaluated from age 50.
- Life-years vs average — the restricted mean survival time (∫S(age)da, ages 40–90) for your settings minus the same integral at RR = 1 (population average), i.e. expected years of event-free life gained or lost.
- Cohort simulation — 150 individual agents are stepped forward one simulated year at a time; each draws its own log-normal risk multiplier and, every year, has probability 1 − e^(−h(age)) of experiencing the event, exactly matching the hazard model above via direct Monte-Carlo sampling. Dots turn from blue to red as events occur, giving an intuitive picture of what a "hazard" means for a real population instead of one idealized curve.
This is an illustrative epidemiological model built from standard survival-analysis mechanics (Gompertz hazard, relative-risk multiplication, Monte-Carlo cohort simulation) — the coefficients are order-of-magnitude realistic but this tool is educational, not a clinical risk calculator.