Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Generating Random Number


From   "Raphael Fraser" <[email protected]>
To   [email protected]
Subject   st: Generating Random Number
Date   Tue, 23 Jan 2007 16:27:38 -0500

How do I generate random numbers between say, 50-100 that do not
repeat themselves?  I have used the following code but this allow the
numbers to repeat themselves:

gen bsid=50*int(50*uniform()+0.5)

Any suggestions?

Raphael
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index