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
New version of cprdhesutil on SSCThanks as always to Kit Baum, a new version of the cprdhesutil package is now available for download…
Stata16: Measurement invariance testing - how to get Chi2 values?Hi there, I want to test for measurement invariance in Stata 16. I want to follow the approach of t…
Is there a command for creating deciles by date?I understand the command xtile ... , nq(10) can create deciles based on the entire data-set being ag…
how can I turn year of birth into age?Hello! I'm trying to recode a variable named V241 in the World Values Survey data set (which can be …
Code to import value labelsHey im trying to import value labels to a set of observations in a variable. Var name: Parentesco …
Subscribe to:
Post Comments (Atom)
0 Response to Generate data subject to pre specified distribution
Post a Comment