[R] Binomial

Alexander Engelhardt alex at chaotic-neutral.de
Thu May 12 11:02:45 CEST 2011


Am 12.05.2011 10:46, schrieb blutack:
> Hi, I need to create a function which generates a Binomial random number
> without using the rbinom function. Do I need to use the choose function or
> am I better just using a sample?
> Thanks.

I think I remember other software who generates binomial data with e.g. 
pi=0.7 by

pi <- 0.7
x <- runif(100)>pi
summary(x)

  -- Alex



More information about the R-help mailing list