Learn R Programming

arm (version 1.1-14)

multicomp.plot: 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

  • pvalueArray of Bayesian p value.
  • significantArray of significance.

References

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

See Also

coefplot

Examples

Run this code
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)
lm.sim <- sim(M1)[["beta"]][,-1]
multicomp.plot(lm.sim, label.as.shortlabel=TRUE, label.on.which.axis=2)

par(old.par)

Run the code above in your browser using DataLab