Statalist The Stata Listserver


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

st: Sampling from a uniform distribution - suggestion


From   [email protected]
To   [email protected]
Subject   st: Sampling from a uniform distribution - suggestion
Date   Wed, 20 Jun 2007 15:13:33 -0300 (BRT)

Dear statalisters,

I would like to generate a random variable X (say 1000 new observations)
wih an uniform distribution on the interval [10, 60].

That�s ok (using Stata):

set obs 1000
gene X =  uniform()*(60-10)+10

However, due to empirical observations from our laboratory experiments (to
produce a more realistic dataset), I have interest in adding one
observation on the interval [2000, 3000] after 5 observations on the
interval [10, 60]. Example:

28 42 12 56 41 2658 26 14 47 59 43 2157 ....

Is there a simple way to generate such kind of observations using Stata?

Thank you for all your help.

Best regards,

Tiago



*
*   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