0

I have a data set with 6 different groups, who each have 73 variables. So I want to test each variable for normality within each group.

I have figured out how to do the shaprio.test(data$IL8), however can I not figure out how to set it in a loop so I don't have to do it 438 times.

Which parameters should I consider and how do I go about it?

I hope you can help in a language I can understand.

Best whishes, A lost PhD studen, Olivia Lie-Andersen

Darshan
  • 2,272
  • 3
  • 31
  • 43
  • I don't quite understand the structure of your data, could you post a subset of it to help us out? Just a few of the groups and a few of the variables, needn't be realistic, just representative. `dput()` could be useful for this. – AkselA Mar 12 '19 at 10:08
  • Hello Olivia, I think the apply() function can help you with this problem. – jkrainer Mar 12 '19 at 10:14
  • If you can post a minimal example, you'd get better help. As it stands, it sounds like a straightforward task with `dplyr::group_by()` and then applying your function on each group. – onlyphantom Mar 12 '19 at 10:16
  • Please add a sample of your data and expected output. You can find more details on what constitutes a good question [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – NelsonGon Mar 12 '19 at 10:17

0 Answers0