I've a dataset looking like this:
> print(mydata)
col1 col2 col3
1 0.819 0.851 0.874
2 0.972 0.703 0.821
3 0.891 0.790 0.951
4 0.839 0.799 0.819
I would like to know if there are significant differences between the three groups col1
, col2
and col3
. For this matter, my guess is that the best way is to run an anova
test.
Please find below the script I used to produce the dataset, to run the test and the Error displayed by R:
> mydata <- data.frame(col1, col2, col3)
> accuracymetrics <- as.vector(mydata)
> anova(accuracymetrics)
Error in UseMethod("anova") : no applicable method for 'anova' applied to an object of class "data.frame"
It's the first time I'm running such an analysis in R so bear with me if this question is not interesting for the forum. Any input to solve this error is appreciated!
anova
function: "object an object containing the results returned by a model fitting function (e.g., lm or glm)." It's meant to be called on a model, not a data frame. That's reflected in your error message. – camillesignificant differences
. Usually you perform the t-test to see if the means of the samples are the same (under the assumption that they come from a normal distribution) or the kolmogorov-smirnov test to see if they come from the same distribution. Anova is based on a regression model usually. – LyzandeR