Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotting of multiple comparisons?

Tags:

comparison

plot

r

When one wishes to compare (test) multiple groups (as is the case, for example, when doing anova), one is confronted with the issue of multiple comparisons. The same applys if we wish to plot the comparisons.

My question is thus, what tools (in R) do you know of that allow plotting that reflects multiple comparisons?

Currently, I know of only two (although I am sure there are more):

  1. TukeyHSD( ) combined with plot( )
  2. The way boxplot chooses the "notches"
like image 631
Tal Galili Avatar asked Dec 10 '25 07:12

Tal Galili


2 Answers

Package multcomp has e.g. plot.cld() -- you could try

library(multcomp)
example(plot.cld)

Also, a quick "multiple comparison plot" search at http://rseek.org reveals a few more packages and Task Views.

like image 186
Dirk Eddelbuettel Avatar answered Dec 13 '25 16:12

Dirk Eddelbuettel


There are some methods around for multiple comparisons in GLMs

http://www.r-bloggers.com/multiple-comparisons-for-glmms-using-glmer-glht/

There is an article about simultaneous inference from the R-Project Handbook of Statistical Analyses (website) ...

http://cran.r-project.org/web/packages/HSAUR2/vignettes/Ch_simultaneous_inference.pdf

plotmeans() from the gplot package. That includes confidence intervals.

Then there is a error.bars.by() function of the package "psych". Plots the means and SDs groupwise from a dataframe.

Some use density plots for visualization.

# Compare MPG distributions for cars with 
# 4,6, or 8 cylinders
library(sm)
attach(mtcars)

# create value labels 
cyl.f <- factor(cyl, levels= c(4,6,8),
  labels = c("4 cylinder", "6 cylinder", "8 cylinder")) 

# plot densities 
sm.density.compare(mpg, cyl, xlab="Miles Per Gallon")
title(main="MPG Distribution by Car Cylinders")

# add legend via mouse click
colfill<-c(2:(2+length(levels(cyl.f)))) 
legend(locator(1), levels(cyl.f), fill=colfill)
like image 42
Doc Avatar answered Dec 13 '25 16:12

Doc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!