On Tue, 26 Oct 2004 13:38:21 +0200 (CEST), [EMAIL PROTECTED] wrote :

>
>Dear all,
>
>it looks like rhyper() gives wrong results compared to theory and compared
>to sample() and rghyper(SuppDists).

I agree, these results look wrong.  The mean also seems high:

> set.seed(1)
> K <- 100
> J <- 60
> N <- K+J
> p <- K/N
> n <- 50
> x <- rhyper(1000000,K,J,n)
> mean(x)
[1] 31.47323
> sd(x)/1000
[1] 0.002925523
> p*n
[1] 31.25
> (mean(x) - p*n)/(sd(x)/1000)
[1] 76.30568

Duncan Murdoch

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to