Re: [R] normality testing with nortest

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Mon 22 May 2006 - 18:16:03 EST

Raymond Wan wrote:

>
> On Mon, 22 May 2006, Uwe Ligges wrote:
>
>> Rolf Turner wrote:
>>
>>> If the nortest package does it differently (and I don't really see
>>> how it possibly could!) then it is confusingly designed. I rather
>>> suspect that its design is just fine, and that it does what it should
>>> do.
>>
>> I suspect so as well.
>> If you think something is wrong, please contact the package maintainer
>> (CCing; he's not reading R-help posts).
>
>
> Ah, ok -- but in this case, it was clearly my misunderstanding which
> is one reason why I never though of writing to the package maintainer.
> I have one of the books that the Nortest documentation cites, but I was
> clearly reading it backwards or upside-down or something as I missed
> several crucial points.
>
> One thing that threw me off (and this is not really specific to
> Nortest as it seems to be correct, but just my understanding), but the
> p-value seems quite unstable. For example:

>
>> ad.test(rnorm(100,mean=5,sd=3))
>
> ...
> A = 0.2382, p-value = 0.7767
>
>> ad.test(rnorm(100,mean=5,sd=3))
>
> ...
> A = 0.1846, p-value = 0.9059
>
>> ad.test(rnorm(100,mean=5,sd=3))
>
> ...
> A = 0.5138, p-value = 0.1887
>
> I mistakenly had thought the p-values would be more stable since I
> am artificially creating a random normal distribution. Is this expected
> for a normality test or is this an issue with how rnorm is producing
> random numbers? I guess if I run it many times, I would find that I
> would get many large values for the p-value?

Well, as many large values as small values, 5% significant differences for the 5% level....

The following looks alright:

hist(replicate(1000, ad.test(rnorm(100,mean=5,sd=3))$p.value))

> Ray
>



R-help@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 Received on Mon May 22 19:31:55 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 22 May 2006 - 20:10:17 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.