How to control the prevalence of outcome, Y? Using the above code, 50% observation got Y = 1. However, I want Y = 1 for 5%, 10% and 20% of observations.

I found one way to do this - make change in step 4 as follows.
/* call randgen(y, "Bernoulli", 0.10); * / -- This will give Y=1 for 10% of obs.

However, this will also lead to random generation of Y and the discrimination of model will be 0.5 which makes model not useful. Is that correct?