[R] TukeyHSD no longer working with aov output?

Peter Ehlers ehlers at ucalgary.ca
Wed Oct 21 06:23:58 CEST 2009


I think that Richard may be correct. In my experience it's always a
bad idea to use numerical labels for factors, especially when
importing data from Excel. But why not do a str() on your data to
see whether R thinks that time is a factor or not? And if not, why
not convert time to factor before passing it to aov()? I'm a bit
uneasy over your use of the phrase "there are two factors of time";
that's not how most stats people would use the terminology and it
may indicate a misunderstanding. You probably mean that there are
two levels of the factor 'time'. Anyway, do str(your_data) and
see what it says.

  -Peter Ehlers

Clayton Coffman wrote:
> There are two factors of time, but they are evenly replicated across all the
> other factors/levels.  The experiment is perfectly balanced except for one
> lost sample, which is deleted automatically in the aov.  I am very certain
> the analysis is correct.  I think its merely a discrepancy between how aov
> and TukeyHSD group the levels of the factor variable. Probably aov handles
> any vector specified as a character vector, whereas TukeyHSD merely assumes
> its a character vector.
> 
> It might be something to refine in the stats package so the functions, which
> are designed somewhat to be used together, can work on the same kinds of
> data.
> 
> On Tue, Oct 20, 2009 at 6:13 PM, Richard M. Heiberger <rmh at temple.edu>wrote:
> 
>> Now I am worried that you have a wrong analysis.
>> the aov function is perfectly happy using either factors or
>> numeric variables.  Are there really only two levels of time,
>> which is what one degree of freedom for time suggests?  Or are there
>> more than two level, but since aov() sees that as a numeric variable
>> it has only one df.
>>
>> csv files can interfere with the interpretation of data values, but
>> not likely in this case.  They too will have numbers interpreted
>> as numeric.
>>
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.
> 
>




More information about the R-help mailing list