[R] How to run Shapiro-Wilk test for each grouped

Thomas Lumley tlumley at u.washington.edu
Tue Apr 13 17:17:00 CEST 2010

On Tue, 13 Apr 2010, Yvonnick Noel wrote:

> Iurie,
>> Noel, thanks a lot. This will help me someday. But I have a question.
>> When we run Shapiro-Wilk test, the homogenity of variances is a
>> mandatory condition?
> No it is not. An homoscedasticity test only makes sense when you have a 
> grouping factor, and a normality test may of course be used in a variety of 
> contexts when you have a unique sample.
> My point was: If you use gaussian models and assume homogeneity of 
> within-group variances, then testing normality is somewhat simplified, since 
> your model residuals are expected to be drawn from a unique normal 
> distribution, and only one normality test on the residuals is necessary (no 
> need for a loop).

Or, as some of us would say, *no* normality test on the residuals is necessary, which is even simpler.


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

More information about the R-help mailing list