I am currently stuck on how to program a data generation process, I am using stata 15.1:
I have a probabilistic defined dummy variable, which could be defined as 6 different states.
For example - in the first observation I have the following:
[p1 p2 p3 p4 p5 p6]
with each probability as its own defined variable and all six probabilities sum to 1.
I would like to generate 6 dummy variables from these probabilities:
[d1 d2 d3 d4 d5 d6]
where the probability of the dummy variable equaling 1 is equal to the probabilities defined above. I've tried a binomial distribution, but because these are dependent (all the other dummies must equal 0 if one takes the value of 1) I am having trouble. A multinomial distribution seems likes the best choice, but I am unsure on how to program the generation of such variables without turning to matlab or R.
Thank you for the guidance,
Eric Wilbrandt
I have a probabilistic defined dummy variable, which could be defined as 6 different states.
For example - in the first observation I have the following:
[p1 p2 p3 p4 p5 p6]
with each probability as its own defined variable and all six probabilities sum to 1.
I would like to generate 6 dummy variables from these probabilities:
[d1 d2 d3 d4 d5 d6]
where the probability of the dummy variable equaling 1 is equal to the probabilities defined above. I've tried a binomial distribution, but because these are dependent (all the other dummies must equal 0 if one takes the value of 1) I am having trouble. A multinomial distribution seems likes the best choice, but I am unsure on how to program the generation of such variables without turning to matlab or R.
Thank you for the guidance,
Eric Wilbrandt
Comment