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
GMM with multi-level moment conditonsHi all, I want to do a two-step GMM estimation with multi-level moment conditons (the objective fun…
Need some help interpreting fe in StataMPI've been teaching myself STATA code for my research paper. I've copied the code and the output of i…
How to get matching results in combination?Dear all, here is the code: Code: tempfile using * Example generated by -dataex-. To install: ssc …
Generate a New Variable: if anyI have a variable called DocVisit that records the number of times a respondent visits a clinic. It …
How do I extract month and year data from combined variables?Hi, I have 51 state name variables(long data) and income data (e.g.starting from inc_JAN_1996, inc_F…
Subscribe to:
Post Comments (Atom)
0 Response to Generate data subject to pre specified distribution
Post a Comment