multicomp.plot: Multiple Comparison Plot

View source: R/multicomp.plot.R

multicomp.plotR Documentation

Multiple Comparison Plot

Description

Plots significant difference of simulated array.

Usage

multicomp.plot(object, alpha = 0.05, main = "Multiple Comparison Plot",
  label = NULL, shortlabel = NULL, show.pvalue = FALSE,
  label.as.shortlabel = FALSE, label.on.which.axis = 3,
  col.low = "lightsteelblue", col.same = "white", col.high = "lightslateblue",
  vertical.line = TRUE, horizontal.line = FALSE,
  vertical.line.lty = 1, horizontal.line.lty = 1, mar=c(3.5,3.5,3.5,3.5))

Arguments

object

Simulated array of coefficients, columns being different variables and rows being simulated result.

alpha

Level of significance to compare.

main

Main label.

label

Labels for simulated parameters.

shortlabel

Short labels to put into the plot.

show.pvalue

Default is FALSE, if set to TRUE replaces short label with Bayesian p value.

label.as.shortlabel

Default is FALSE, if set to TRUE takes first 2 character of label and use it as short label.

label.on.which.axis

default is the 3rd (top) axis.

col.low

Color of significantly low coefficients.

col.same

Color of not significant difference.

col.high

Color of significantly high coefficients.

vertical.line

Default is TRUE, if set to FALSE does not draw vertical line.

horizontal.line

Default is FALSE, if set to TRUE draws horizontal line.

vertical.line.lty

Line type of vertical line.

horizontal.line.lty

Line type of horizontal line.

mar

A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot. The default is c(3.5,3.5,3.5,3.5).

Value

pvalue

Array of Bayesian p value.

significant

Array of significance.

Author(s)

Masanao Yajima yajima@stat.columbia.edu, Andrew Gelman gelman@stat.columbia.edu

References

Andrew Gelman and Jennifer Hill. (2006). Data Analysis Using Regression and Multilevel/Hierarchical Models. Cambridge University Press.

See Also

coefplot

Examples

old.par <- par(no.readonly = TRUE)

# example 1
simulation.array <- data.frame(coef1=rnorm(100,10,2), coef2=rnorm(100,5,2),
                      coef3=rnorm(100,0,1), coef4=rnorm(100,-5,3),
                      coef5=rnorm(100,-2,1))
short.lab <- c("c01", "c02", "c03", "c04", "c05")
multicomp.plot(simulation.array[,1:4], label.as.shortlabel=TRUE)

# wraper for multicomp.plot
mcplot(simulation.array, shortlabel = short.lab)

# example 2
data(lalonde)
M1 <- lm(re78 ~ treat + re74 + re75 + age + educ + u74 + u75, data=lalonde)
M1.sim <- sim(M1)
lm.sim <- coef(M1.sim)[,-1]
multicomp.plot(lm.sim, label.as.shortlabel=TRUE, label.on.which.axis=2)

par(old.par)

arm documentation built on June 25, 2024, 1:14 a.m.