Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: random uniform variable with unequal probabilities
From
Tomáš Houška <[email protected]>
To
[email protected]
Subject
st: random uniform variable with unequal probabilities
Date
Mon, 19 Nov 2012 12:44:49 +0100
Hello Statalist,
I need to generate a random variable from uniform distribution, but
the probabilities are not not same for each option. The variable is
discrete in interval [10,19] and is generated 10times. Each time one
of the options has twice as high probability of occuring as the
others. So in some sence, the draw is two-staged - in the first stage
a random number (n) between 1 and 10 is generated and then that
particular n-th option in the interval [10,19] has a probability 0.2
of occuring, the other options have a probability 0.8/9 each.
How can I generate such variable?
Thank you!!
Tomas
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/