Hi,
Can't you do something like:
x <- c(1,1,1,1,1,1,0,0,0,0)
sample(x, 30, T)
Best Wishes,
Jenny
>X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on hypatia.math.ethz.ch
>X-Spam-Level:
>X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED, DKIM_VERIFIED,
HTML_MESSAGE autolearn
On 10/3/07, stat stat <[EMAIL PROTECTED]> wrote:
> I want to get a sample of some arbitrary size from a population having only
> two values 0 and 1 with replacement, but with different probability for
> selection. For example 0 will be selected with probability 0.4 and 1 with
> 0.6. I could use
2 matches
Mail list logo