How to select lines within Tukey's test result ?

This mays be a dumb question, but I'm kinda of stuck.

I've got a .csv data files organized in Year, Month, Day and Likes helping me analyze my Instragram account (yeah I'm a bit bored but basically I've got 2020,March,Monday,38).

I wanted to compare the mean of each month with each other in order to see if there was an actual difference or not (independent data) from one month to the other.

According to the ANOVA result, there is a difference (1.93e-07) but when I go with the TukeyHSD test, I end up with a huge list of each combination and I can't seem to select which line I want.

I would like to select lines with a p-value < 0.05 or lines comparing only a specific month.

I couldn't find any help, apparently I can't work on the Tukey's result like a list or a dataframe. I don't really know how to do it =/

If any of you have a solution thanks in advance !

from the documentation

Value
A list of class c("multicomp", "TukeyHSD"), with one component for each term requested in which. Each component is a matrix with columns diff giving the difference in the observed means, lwr giving the lower end point of the interval, upr giving the upper end point and p adj giving the p-value after adjustment for the multiple comparisons.

so here is the example from the documentation where I go ahead and take the tension matrix that was made and put it to a tibble to work with further


summary(fm1 <- aov(breaks ~ wool + tension, data = warpbreaks))
t1 <- TukeyHSD(fm1, "tension", ordered = TRUE)
(result_table <- t1$tension %>% as_tibble(rownames = "comparitors"))

result_table %>% filter(`p adj` < 0.05)

Hey !

Thank you so much, it works real nice now =)
Not entirely sure about some of the component but I think I got the general idea by changing different parameters.

Thanks for the quick answer !

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.