I've tried to run a Tukey post-hoc but keep getting this weird error, whether the aov was significant or not. treat_code is a dummy variable, but that shouldn't matter. Any suggestions? Thanks Amy> summary(aov(EtoH~treat_code, mydata))Df Sum Sq Mean Sq F value Pr(>F) treat_code 1 16.44 16.44 11.027 0.001014 ** Residuals 287 427.91 1.49 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1> TukeyHSD(aov(EtoH~treat_code, mydata))Error in TukeyHSD.aov(aov(EtoH ~ treat_code, mydata)) : no factors in the fitted model In addition: Warning message: In replications(paste("~", xx), data = mf) : non-factors ignored: treat_code -- Amy Freitag Ph.D. student, Marine Science and Conservation Nicholas School for the Environment Duke University aef10 at duke.edu
> treat_code is a dummy > variable, but that shouldn't matter. ?Any suggestions?It does matter to TukeyHSD. If treat_code is a numeric variable with discrete values 0 and 1, then it does not have class "factor". It is true that aov will give the same ANOVA table for a two-level factor as for a two-value numeric. It will give different ANOVA tables if there are more than two values. TukeyHSD will refuse to do anything for a numeric variable. It insists on factors. You must use the statement mydata$treat_code <- factor(mydata$treat_code) before creating the aov object that you give to TukeyHSD. Rich
treat_code isn't a factor, but a numeric variable. You should use: summary(aov(EtoH~as.factor(treat_code), mydata)) TukeyHSD(aov(EtoH~as.factor(treat_code), mydata)) Bart -- View this message in context: http://n4.nabble.com/TukeyHSD-troubles-tp1570205p1570228.html Sent from the R help mailing list archive at Nabble.com.