Re: [R] Help needed on Normality test

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Tue, 29 Jan 2008 14:03:20 -0700

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.
>
______________________________________________ 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.
Received on Wed 30 Jan 2008 - 01:05:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Jan 2008 - 01:30:10 GMT.

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

list of date sections of archive