a pediatric population should be generated from 2 to 20 based on the below command for 2000 subjects:
NID=2000
TM<-
data.frame(ID=seq(1,NID,by=1),AGEM=round(runif(NID,2,20)*12,1),SEX=rep(1:2,each=round(NID/2)))
However, I would like to generate these 2000 subjects with
34% subjects from age 2 to 10
66% subjects from age 11 to 20
Is there a smart way to do this and also keep original randomness? Thanks!