0
anov_np <- kruskal.test(Sepal.Length ~Species, data=iris)

Hello, Here is the syntaxe for one parameter. I want to make a non parametric anova of several columns at the same time without loop

  • "non parametric anova of several columns": do you mean "sevarl anovas, each with a different column as the dependent" or "a single anova with more than one predictor". And "without loop": would you accept `lapply` or similar? – Limey Jun 26 '20 at 11:32
  • i mean a single anova for each column. I can accept lapply or similar –  Jun 26 '20 at 12:07

1 Answers1

1
cols <- list("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")
lapply(cols, function(x) kruskal.test(as.formula(paste(x, " ~ Species")), data=iris))
Limey
  • 10,234
  • 2
  • 12
  • 32