问题
I'm having trouble extracting and graphing a Tukey test that I did. I did a fairly basic one on an ANOVA but I only want to plot the significant mean differences. When I use the plain
Tukey <- TukeyHSD(x=aov.out, 'Species', conf.level=0.95)
plot(Tukey)
The result is
Is there any way to remove all the insignificant mean levels? When I attempted to, I was forced to turn it into a dataframe, which then could not be plotted in the same way.
Tukey <- Tukey[[1]][row_to_keep,]
NOTE: No packages were installed.
回答1:
Better late than never I hope... You can just subset the matrix inside the TukeyHSD object.
SigOnly <- Tukey
SigOnly$species <- SigOnly$species[SigOnly$species[,'p adj'] < .05, ]
plot(SigOnly)
来源:https://stackoverflow.com/questions/31838046/tukey-graphing-problems-in-r