I want to run Shapiro-Wilk test for each variable in my dataset, each grouped by variable groupFactor. I have these working commands:
> data.n<-names(data) # put names into a vector called data.n > by(eval(parse(text=(paste("data",data.n[3],sep="$")))), data$factor, > shapiro.test) #run shapiro.test but I must to change the variable number manualy. How to automate this? I tried this: > for (r in 3:18) { > by(eval(parse(text=(paste("data",data.n[3],sep="$")))), data$groupFactor, > shapiro.test) > } but not working and no errors. Why? Please help. -- Regards, Iurie Malai, Senior Lecturer Department of Psychology Faculty of Psychology and Special Education Ion Creanga Moldova Pedagogical State University - www.upsm.md http://en.wikipedia.org/wiki/Ion_Creang%C4%83_Pedagogical_State_University ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.