plotComp: Compare Two or More bma Objects

View source: R/aux_outer.R

plotCompR Documentation

Compare Two or More bma Objects

Description

Plots a comparison of posterior inclusion probabilites, coefficients or their standard deviation between various bma objects

Usage

plotComp(
  ...,
  varNr = NULL,
  comp = "PIP",
  exact = FALSE,
  include.legend = TRUE,
  add.grid = TRUE,
  do.par = TRUE,
  cex.xaxis = 0.8
)

Arguments

...

one or more objects of class 'bma' to be compared. plotComp passes on any other parameters in ...{} to matplot.

varNr

optionally, covariate indices to be included in the plot, can be either integer vector or character vector - see examples

comp

a character denoting what should be compared: comp="PIP" (default) for posterior inclusion probabilities, comp="Post Mean" for coefficients, comp="Post SD" for their standard deviations, comp="Std Mean" or standardized coefficients, or comp="Std SD" for standardized standard deviations

exact

if FALSE, the statistics to be compared are based on aggregate bma statistics, if TRUE, they are based solely on the best models retained in the bma objects

include.legend

whether to include a default legend in the plot (custom legends can be added with the command legend)

add.grid

whether to add a grid to the plot

do.par

whether to adjust par("mar") in order to fit in the tick labels on the x-axis

cex.xaxis

font size scaling parameter for the x-axis - cf. argument cex.axis in par

See Also

coef.bma for the underlying function

Check http://bms.zeugner.eu for additional help.

Examples


## sample two simple bma objects
data(datafls)
mm1=bms(datafls[,1:15])
mm2=bms(datafls[,1:15])

#compare PIPs
plotComp(mm1,mm2)

#compare standardized coefficeitns
plotComp(mm1,mm2,comp="Std Mean")

#...based on the lieklihoods of best models 
plotComp(mm1,mm2,comp="Std Mean",exact=TRUE)

#plot only PIPs for first four covariates
plotComp(mm1,mm2,varNr=1:4, col=c("black","red"))

#plot only coefficients for covariates 'GDP60 ' and 'LifeExp'
plotComp(mm1,mm2,varNr=c("GDP60", "LifeExp"),comp="Post Mean")




BMS documentation built on Aug. 9, 2022, 5:08 p.m.