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]
Re: st: looking for more efficient programming for randomly shuffling list of numbers
From
Scott Merryman <[email protected]>
To
[email protected]
Subject
Re: st: looking for more efficient programming for randomly shuffling list of numbers
Date
Thu, 26 Aug 2010 11:05:37 -0500
So you want 9600 random variables uniformly distributed [1, 20]?
You could use mata:
mata: u = trunc(runiform(20,9600):*20 :+1)
getmata (u*)=u,replace
Scott
On Thu, Aug 26, 2010 at 10:11 AM, Evelyn Ersanilli
<[email protected]> wrote:
> Dear Statalisters,
>
> For a survey I need to make stickers that can be used to randomly select respondents within a household.
> These stickers should contain the numbers 1-20 in a random order (most households will have less than 20 members). Each sticker should have its own random order, though it is not a problem if by chance some stickers are the same. The stickers should be generated in such a way that each order of numbers 1-20 should be possible and equally likely.
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/