Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: select three non-identical random elements

From   Tomáš Houška <>
Subject   st: select three non-identical random elements
Date   Thu, 4 Apr 2013 11:42:20 +0200

Dear Statalist,

I have list of items create by -levelsof- macro and I would like to select
three items from that list at random and for them to be non-repetitive
(i.e. each one can appear only once in the selection).

Lets say I have a list -local list "one two three four five six"- and I
would like to get
local random1 =
local random2 =
local random3 =

where each one is a random selection from the local list and each item
appears at max once.
I would appreciate any help on how to do that.

Thank you!
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index