[R] Help needed on Normality test
Greg Snow
Greg.Snow at imail.org
Tue Jan 29 22:03:20 CET 2008
The 2 tests are testing different hypotheses. The KS test is testing
the null that the data comes from a normal with mean 0 and sd
0.11908969, this can be false if the data is not normal or if the mean
is not 0 or if the sd is not 0.0119 or any combination of the 3.
The Shapiro test was not given a specific mean and sd so it is just
testing normality, not mean or sd.
You should really be asking the question of why do you want to know if
the data is normal? If your sample size is small then these tests don't
have enough power to truly distinguish between distributions (and 1
outlier can cause you to falsly reject normality if it is true). If
your sample size is large then the CLT comes into play in many common
analyses and it does not matter if the population is normal or not. In
many cases the better question is "Is this data close enough to normal?"
and that question is often better answered by a qq normal plot than a
p-value.
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Megh Dal
> Sent: Tuesday, January 29, 2008 7:57 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Help needed on Normality test
>
> Hi all T gurus,
>
> I would like to test if my dataset is indeed from N(0, 0.011908969).
>
> K.S. test gives following result:
>
> > ks.test(data, "pnorm", 0, 0.011908969)
> One-sample Kolmogorov-Smirnov test
> data: data
> D = 0.1092, p-value = 1.318e-05
> alternative hypothesis: two-sided
>
> How ever "Shapiro-Wilk" test give following :
> > shapiro.test(data)
> Shapiro-Wilk normality test
> data: data
> W = 0.9946, p-value = 0.07562
>
> also,
>
> > sd(data)
> [1] 0.01625074
>
> 2nd test saying data is from normal however 1st isnot.
> Which one is correct? Am I missing something?
>
> Regards,
>
>
> ---------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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