Age should be generated from 2 to 20 based on the below command for 2000 subjects:
AGE=round(runif(2000,2,20),1)
However, I would like to generate these 2000 subjects with
29% subjects from age 2 to 4
17% subjects from age 5 to 9
24% subjects from age 10 to 14
30% subjects from age 15 to 20
Is there a smart way to do this? Thanks!


雷达卡




京公网安备 11010802022788号







