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.
Related Posts with Generate data subject to pre specified distribution
Appending Files Conditional on File NameI have a number of files that are named the following: lp1_x0_rf1.dta ... lp1_x9_rf1.dta lp1_x0_rf2…
How to control MRTs in PPML Gravity ModelCan i control MRTs in PPML method by estimating exporter, importer and year group dummies by followi…
Merging Data with a prefix in the merging variableI wish to perform merges of the following nature: My first dataset is as follows: Code: * Exampl…
Changing values of yes/no binary variables from 1/2 to 1/0 using loopHello, I believe this is a common problem but I have not found an answer online. I have a large dat…
Test for endogeneity when using in between-effectsHello everyone, I am trying to run the following model xi: xtivreg sba ids fco vvm nan avi i.year (…
Subscribe to:
Post Comments (Atom)
0 Response to Generate data subject to pre specified distribution
Post a Comment