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.

# S3 method for varbvs
plot(x, score, groups, vars = NULL, var.labels,
draw.threshold = NA, gap = 0,col = "midnightblue", pch = 20,
scales = NULL, xlab = "", ylab = "",
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), ...)

## Arguments

x Output of function varbvs. 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. 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. Indices (type integer) or names (type character) of variables to highlight and label. By default, vars = NULL, meaning no variables are highlighted. Labels to accompany the highlighted variables only. If missing, labels are retrieved from x. If var.labels = NULL, no labels are plotted. Plot a horizontal line at this location on the vertical axis. Amount of space to leave between each group of variables in the plot. Argument passed to xyplot specifying color of points. Argument passed to xyplot specifying symbol type. Argument passed to xyplot specifying how x- and y-axes are drawn. Argument passed to xyplot specifying horizontal axis title. Argument passed to xyplot specifying vertical axis title. Additional arguments passed to panel.abline specifying how to draw the horizontal line at the location specified by draw.threshold. Additional arguments passed to xyplot for drawing the highlighted variables. Additional arguments passed to ltext for specifying how the labels of the highlighted variables are drawn in the plot. Additional arguments passed to xyplot for drawing the un-highlighted variables.

## Details

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

## Value

An object of class "trellis" generated by functions xyplot and as.layer.

## 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.

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