0

I need to run two way ANOVA and post-hoc test in R. And I have a CSV file like this:

BLOCK,AdvTraining,Destillation,Squeezing
Clean,4,3,10
Clean,10,3,13
Clean,4,1,8
FGSM,402,237,521
FGSM,290,129,483
FGSM,407,262,568
BIM,998,14,285
BIM,972,9,321
BIM,994,12,451
DeepFool,421,419,661
DeepFool,410,425,663
DeepFool,378,386,585

There are 4 blocks (Clean, FGSM, BIM, DeepFool) and 3 treatments (AdvTraining, Destillation, Squeezing).

All blocks have same number of samples, without missing value.

This file is intended to run two way ANOVA from excel.

I notice R require a single column structure, something like this:

Clean,AdvTraining,4
Clean,Destillation,3
Clean,Squeezing,10
...
DeepFool,AdvTraining,378
DeepFool,Destillation,386
DeepFool,Squeezing,585

How can I do this?

Notice that the actual file is much larger. It has more blocks and more than 500 rows. So changing it manually isn't an option.

FisNaN
  • 2,517
  • 2
  • 24
  • 39

0 Answers0