Possible Duplicate:
How to generate random categorical data?
For example, let's say I have two variables, Var1 and Var2.
Var1 can have values A, B and C and Var2 can have values 1, 2 and 3.
Now the tricky bit:
I want to achieve that conditional probabilities of observing 1, 2 and 3 depend on Var1.
For example if Var1 has the value A, then probabilities are 20%, 30% and 50% for observing 1, 2 and 3. If Var1 equals B probabilities are 50%, 30% and 20%.