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

Iurie Malai iurie.malai at gmail.com
Mon Apr 12 21:20:37 CEST 2010


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?


2010/4/12 Yvonnick Noel <yvonnick.noel at uhb.fr>:
> Dear Iurie,
>
>> I want to run Shapiro-Wilk test for each variable in my dataset, each
>> grouped by variable groupFactor.
>
> Note that, at least on a single dependent variable with a grouping variable,
> a possible simplification may arise when homogeneity of variances is assumed
> and reasonable. You may want to do a single normality test on group-centered
> data :
>
> shapiro.test(residuals(lm(data[,1]~groupFactor)))
>
>
> HTH,
>
> Yvonnick Noel
> University of Brittany, Rennes 2
> France
>



More information about the R-help mailing list