Bookmark and Share

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   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: looking for more efficient programming for randomly shuffling list of numbers
Date   Thu, 26 Aug 2010 12:10:08 -0400

Scott,

I guess they must also by unique within each household. if runiform()
gives 100 or 101, trunc()
will round it to the same value, and that will be no good, since two
persons will end up with the
same stickers.

Best, S.R.



On Thu, Aug 26, 2010 at 12:05 PM, Scott Merryman
<[email protected]> wrote:
> 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/
>

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index