cap program drop Diabetes_R_intervene0 program define Diabetes_R_intervene0 syntax [varlist] [if] [in], is_startyr(integer) * Diabetes R Initial Intervention * for approx a quarter of the population, if the person is overweight or obese and doesnt have diabetes, then set them to be treated marksample touse, zeroweight strok novarlist if `is_startyr' { cap drop diabdraw gen diabdraw = uniform() replace treat_now = (obese == 1 | overwt == 1) & diabe == 0 & diabdraw<=0.25 if `touse' replace treat_effective = 0 if `touse' } else { replace diabdraw = uniform() if diabdraw == . } end