[R] shapiro wilk normality test

Robert A LaBudde ral at lcfltd.com
Sat Jul 12 17:55:26 CEST 2008

At 11:30 AM 7/12/2008, Bunny, lautloscrew.com wrote:
>Hi everybody,
>somehow i dont get the shapiro wilk test for normality. i just can´t
>find what the H0 is .
>i tried :
>  shapiro.test(rnorm(5000))
>         Shapiro-Wilk normality test
>data:  rnorm(5000)
>W = 0.9997, p-value = 0.6205
>If normality is the H0, the test says it´s probably not normal, doesn ´t it ?
>5000 is the biggest n allowed by the test...
>are there any other test ? ( i know qqnorm already ;)
>thanks in advance

Yes, H0 is "normality". The P-value, as for other 
statistical tests, measures the probability that 
this sample could have arisen from the population under H0.

0.62 is a probability very compatible with H0. 
The typical rejection criterion would be a 
P-value < 0.05, which is not the case here.

The limitation to n = 5000 is not serious, as 
even a few hundred data should take you to the 
asymptotic region. Use sample() to select the 
data at random from within your data set to avoid bias in using the test. E.g.,

shapiro.test(sample(mydata, 1000, replace=TRUE))

Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: ral at lcfltd.com
Least Cost Formulations, Ltd.            URL: http://lcfltd.com/
824 Timberlake Drive                     Tel: 757-467-0954
Virginia Beach, VA 23464-3239            Fax: 757-467-2947

"Vere scire est per causas scire"

More information about the R-help mailing list