Is there a more efficient way to simulate in R, by exposition factor, gender and disease profile?
There are a few improvements to your (I'm assuming that genero and gender are the same variable).


Very important. Use a space around the assignment operator! x&lt;-5 Does this mean assign 5 to x to is x less than -5
Rather then rep(0,n) just use numeric(n)
Your loops should be rewritten. For example:

##I presume that exposicao is exposition.
for(i in 1:n){if(u[i]&gt;0.15)exposicao[i]&lt;-1}


can be written as:

exposition[runif(n) &gt; 0.15] = 1


and 

for(j in 1:n){{if(exposicao[j]==1 &amp; b[j]&gt;0.5)genero[j]&lt;-1} 
{if(exposicao[j]==0 &amp; b[j]&lt;0.2)genero[j]&lt;-1}} 


can be written as:

genero[exposicao==1 &amp; b&gt;0.5] = 1
genero[exposicao==0 &amp; b&gt;0.2] = 1