[R] Normality test
Greg.Snow at imail.org
Wed Sep 3 17:31:49 CEST 2008
What is the distribution of the p-value when the null hypothesis is true?
This is an important question that unfortunately tends to get glossed over or left out completely in many courses due to the amount of information that needs to be packed into them.
For most appropriate tests, when the null hypothesis is true and all other assumptions are true, the p-value is distributed as uniform(0,1). Hence the probability of a type I error is alpha for any value of alpha. Therefore, when the null is true, the likelihoods of getting a p-value of 0.99, 0.051, 0.049, or 0.0001 are all exactly the same.
If you want a high p-value for a normality test, just collect only 1 data point, no matter what it's value is, it is completely consistant with the assumption that it came from some normal distribution (p-value=1).
For large sample sizes the important question is not "did this data come from an exact normal distribution?", but rather, "Is the distribution this data came from close enough to normal?".
If you really feel the need for a test of normality in large sample sizes, then see this post:
Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Williams, Robin
> Sent: Wednesday, September 03, 2008 8:34 AM
> To: r-help at r-project.org
> Subject: [R] Normality test
> I am looking for a normality test in R to see if a vector of
> data I have can be assumed to be normally distributed and
> hence used in a linear regression.
> > help.search("normality test")
> suggests the Shapiro test, ?shapiro.test.
> Now maybe I am interpreting things incorrectly (as is usually
> the case), am I right in assuming that this is a composite
> test for normality, and hence a high p-value would suggest
> that the sample is normally distributed? As a test I did
> a few times, and achieved very different p-values, so I
> cannot be sure.
> I had assumed that a random sample of 4500 would have a very
> high p-value on all occasions but it appears not, this is interesting.
> Are there any other tests that people would recommend over
> this one in the base packages? I assume not as help.search
> did not suggest any.
> So am I right about a high p-value suggesting normality?
> Many thanks for any help.
> Robin Williams
> Met Office summer intern - Health Forecasting
> robin.williams at metoffice.gov.uk
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help