I need to run a one way ANOVA on every column in a data frame based on another column. My data frame has 57 columns, so it is very time consuming to type out every column name. Here is part of my data frame.
So basically, I need this function run for every column
aov(df$PGY_16 ~ df$Total_Time_cm_16, df)
So I need a loop to run that for every column in my data frame.
Any help would be greatly appreciated!
lapply
should do. – Enigma