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

Yvonnick Noel yvonnick.noel at uhb.fr
Mon Apr 12 09:56:51 CEST 2010


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