I want to do a post-hoc test for a significant ANOVA I've done successfully.
I have 5 conditions (target_onset) across which I want to compare reaction times (key_resp.rt) in a df called data_clean. target_onset and key_resp.rt are columns.
This is how I did the ANOVA, which worked fine:
cond.aov <- aov(data_clean$target_onset ~ data_clean$key_resp.rt)
summary(cond.aov)
Next, I want to see what a post-hoc test says to find out which differences between the 5 conditions are significant.
I know that TukeyHSD only takes factors. So I factorized my columns of interest:
data_clean$target_onset <- factor(data_clean$target_onset)
data_clean$key_resp.rt <- factor(data_clean$key_resp.rt)
TukeyHSD(aov(data_clean$target_onset ~ data_clean$key_resp.rt))
However, when I run this code, I get the following error:
Error in class(y) <- oldClass(x) : adding class "factor" to an invalid object In addition: Warning messages: 1: In model.response(mf, "numeric") : using type = "numeric" with a factor response will be ignored 2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
Any suggestions would be helpful. Thanks in advance.