kassambara / rstatix

Pipe-friendly Framework for Basic Statistical Tests in R
https://rpkgs.datanovia.com/rstatix/
432 stars 51 forks source link

Performing post hoc Tukey test after Repeated Measures ANOVA #199

Open reneemoerkens opened 7 months ago

reneemoerkens commented 7 months ago

Hello, and thanks for the very helpful package!

I was wondering whether you could help me with the following error: I am trying to perform a post hoc Tukey test after performing a repeated measures ANOVA:

res.aov <- aov(dissociation_viability ~ Condition + Error(cell_line/Condition), data = metadata_table) tukey.plot.test<-TukeyHSD(res.aov)

Running the repeated measures ANOVA works well and gives me this output: image

However the Tukey test gives me the error: Error in UseMethod("TukeyHSD") : no applicable method for 'TukeyHSD' applied to an object of class "c('aovlist', 'listof')"

I tried first subsetting one of the tables from the res.aov object (which is a list) before running the Tukey test: res.aov <- res.aov[['cell_line:Condition']] But this still gives me this error: Error in model.tables.aov(x, "means") : this fit does not inherit from "lm"

Maybe I am misunderstanding something, so any feedback would be very welcome.

ricoderks commented 1 month ago

I ran into the same problem. For some reason it is very difficult to do this in R. Maybe I'am mssing something!