Hi

I am new to STATA. I want to generate a random variable with integer between 0 and 4 satisfying certain distribution, such as the percentage of 0 is 9%, 1 is 6%, 2 is 5%, 3 is 40% and 4 is 40%. How can I do that? I tried gen a=runiformint(0,4) with if conditions. Appreciate any help.