Stata tip 48: Discrete uses for uniform()

The Stata Journal (2007) Vol. 7 No. 3, pp. 434-435.


The uniform() function generates random draws from a uniform distribution between zero and one. One of its many uses is creating random draws from a discrete distribution where each possible value has a known probability. This principle can also be used to create random draws from a binomial distribution.

Link to full text