Skip to content
Prev 276343 / 398506 Next

Why can't this function be used with the 'by' command?

I believe it has to do with passing multiple columns to the
shapiro.test. Note that

by(x[,1:2], x$group, function(x) shapiro.test(x)[[2]])

doesn't work but

by(x[,1:2], x$group, function(x) shapiro.test(x[,1])[[2]])

does.

Michael
On Thu, Nov 3, 2011 at 8:08 AM, Kaiyin Zhong <kindlychung at gmail.com> wrote: