Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Tomáš Houška <xbender@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

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/

**Follow-Ups**:**Re: st: random uniform variable with unequal probabilities***From:*Nick Cox <njcoxstata@gmail.com>

**Re: st: random uniform variable with unequal probabilities***From:*Maarten Buis <maartenlbuis@gmail.com>

- Prev by Date:
**st: R: Implementing mmsel** - Next by Date:
**st: Is rho the right indicator in a multilevel analysis?** - Previous by thread:
**st: R: Implementing mmsel** - Next by thread:
**Re: st: random uniform variable with unequal probabilities** - Index(es):