Learn R Programming

varbvs (version 2.6-10)

plot.varbvs: Summarize variable selection results in a single plot.

Description

Generate a single plot that summarizes the results of fitting the Bayesian variable selection model to the data. When the variables are genetic markers, the groups are chromosomes, and the posterior probabilities are plotted on the vertical axis (typically on the logarithmic scale), the figure resembles a "Manhattan plot" typically used to summarize the results of a genome-wide association study or quantitative trait locus (QTL) mapping study.

Usage

# S3 method for varbvs
plot(x, score, groups, vars = NULL, var.labels,
  draw.threshold = NA, gap = 0,col = "midnightblue", pch = 20,
  scales = NULL, xlab = "variable", ylab = "posterior probability",
  main = "fitted varbvs model: variable selection results",
  abline.args = list(lty = "dotted",col = "orangered"),
  vars.xyplot.args = list(pch = 20,col = "magenta"),
  vars.ltext.args = list(col = "black",pos = 4,cex = 0.5), 
  par.settings = list(par.main.text = list(font = 1,cex = 0.8),
                      layout.heights = list(axis.top = 0, axis.bottom = 0)),
  ...)

Value

An object of class "trellis" generated by functions

xyplot and as.layer.

Arguments

x

Output of function varbvs.

score

Value to plot on vertical axis. Must be a numeric vector with one entry for each variable. If missing, the posterior inclusion probability for each variable is plotted in the vertical axis, in which this probability is averaged over hyperparameter settings, treating x$logw as (unnormalized) log-marginal probabilities. As alternative, set score to the posterior inclusion probabilities that ignore correlations, using varbvsindep.

groups

Group the variables in the plot according to this argument. This must be a vector with one entry for each variable. If missing, all variables are treated as a single group. This is useful for grouping the genetic markers by chromosome in a genome-wide association study.

vars

Indices (type integer) or names (type character) of variables to highlight and label. By default, vars = NULL, meaning no variables are highlighted.

var.labels

Labels to accompany the highlighted variables only. If missing, labels are retrieved from x. If var.labels = NULL, no labels are plotted.

draw.threshold

Plot a horizontal line at this location on the vertical axis.

gap

Amount of space to leave between each group of variables in the plot.

col

Argument passed to xyplot specifying color of points.

pch

Argument passed to xyplot specifying symbol type.

scales

Argument passed to xyplot specifying how x- and y-axes are drawn.

xlab

Argument passed to xyplot specifying horizontal axis title.

ylab

Argument passed to xyplot specifying vertical axis title.

main

Argument passed to xyplot specifying main plot title.

abline.args

Additional arguments passed to panel.abline specifying how to draw the horizontal line at the location specified by draw.threshold.

vars.xyplot.args

Additional arguments passed to xyplot for drawing the highlighted variables.

vars.ltext.args

Additional arguments passed to ltext for specifying how the labels of the highlighted variables are drawn in the plot.

par.settings

Argument passed to xyplot specifying additional adjustments to the plot settings.

...

Additional arguments passed to xyplot for drawing the un-highlighted variables.

Author

Peter Carbonetto peter.carbonetto@gmail.com

Details

Note that plot.varbvs uses function xyplot from the lattice package, and as.layer from the latticeExtra package.

References

P. Carbonetto and M. Stephens (2012). Scalable variational inference for Bayesian variable selection in regression, and its accuracy in genetic association studies. Bayesian Analysis 7, 73--108.

See Also

xyplot, ltext, panel.abline, varbvs, summary.varbvs, varbvsindep