> 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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to