[R] Jarque-Bera and rnorm()

Martin Becker martin.becker at mx.uni-saarland.de
Fri Apr 27 13:53:36 CEST 2007


Murali Menon schrieb:
> Folks,
>
> I'm a bit puzzled by the fact that if I generate 100,000 standard 
> normal variates using rnorm() and perform the Jarque-Bera on the 
> resulting vector, I get p-values that vary drastically from run to 
> run. Is this expected? 
Yes.
> Surely the p-val should be close to 1 for each test?
No. The p-value should rather be uniformly distributed on [0;1]. You can try

library(lawstat)
ttt<-numeric(1000)
for (i in 1:length(ttt)) ttt[i]<-rjb.test(rnorm(10000))$p.value
hist(ttt)

to confirm that the combination of rnorm and rjb.test seems to behave 
correctly here.

Regards,

  Martin

>
> Are 100,000 variates sufficient for this test?
>

[...]

> Please advise. Thanks,
>
> Murali
>
> _________________________________________________________________
> MSN is giving away a trip to Vegas to see Elton John.  Enter to win 
> today.
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list