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
Replace variable if commandI have a set of European regions for many different years and I would like to create a variable whic…
Error in Stata 16Hello,
I try to run "ssc new" in Stata 16 IC on Windows and get the following error: "file ssc_resu…
Westerlund cointegration testI am attempting to estimate a panel co-integration. I converted 'country' to numeric using encode co…
Group IDs for observation-specific date range and a dummyHi,
I have data on project teams for a number of different companies. Included in the data is a DAT…
Unit-root test for a bounded seriesHi All,
I would like to test for unit root for a series that is bounded, i.e., a series which lies …
Subscribe to:
Post Comments (Atom)
0 Response to Generate data subject to pre specified distribution
Post a Comment