开发者

Plotting of multiple comparisons?

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"


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.


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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜