<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html>
  <head>
  <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Summarize variable selection results in a single plot. — plot.varbvs • varbvs</title>

<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
<!-- Bootstrap -->

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!-- Font Awesome icons -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">


<!-- pkgdown -->
<link href="../pkgdown.css" rel="stylesheet">
<script src="../jquery.sticky-kit.min.js"></script>
<script src="../pkgdown.js"></script>

<!-- mathjax -->
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->


  </head>

  <body>
    <div class="container template-reference-topic">
      <header>
      <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="../index.html">varbvs</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="../index.html">Home</a>
</li>
<li>
  <a href="../articles/index.html">Vignettes</a>
</li>
<li>
  <a href="../reference/index.html">Reference</a>
</li>
      </ul>
      
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="http://github.com/pcarbo/varbvs">
    <span class="fa fa-github fa-lg"></span>
     
  </a>
</li>
      </ul>
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      
      </header>

      <div class="row">
  <div class="col-md-9 contents">
    <div class="page-header">
    <h1>Summarize variable selection results in a single plot.</h1>
    </div>

    
    <p>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.</p>
    

    <pre><span class='co'># S3 method for varbvs</span>
<span class='fu'>plot</span>(<span class='no'>x</span>, <span class='no'>score</span>, <span class='no'>groups</span>, <span class='kw'>vars</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>var.labels</span>,
  <span class='kw'>draw.threshold</span> <span class='kw'>=</span> <span class='fl'>NA</span>, <span class='kw'>gap</span> <span class='kw'>=</span> <span class='fl'>0</span>,<span class='kw'>col</span> <span class='kw'>=</span> <span class='st'>"midnightblue"</span>, <span class='kw'>pch</span> <span class='kw'>=</span> <span class='fl'>20</span>,
  <span class='kw'>scales</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>xlab</span> <span class='kw'>=</span> <span class='st'>""</span>, <span class='kw'>ylab</span> <span class='kw'>=</span> <span class='st'>""</span>,
  <span class='kw'>abline.args</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>lty</span> <span class='kw'>=</span> <span class='st'>"dotted"</span>,<span class='kw'>col</span> <span class='kw'>=</span> <span class='st'>"orangered"</span>),
  <span class='kw'>vars.xyplot.args</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>pch</span> <span class='kw'>=</span> <span class='fl'>20</span>,<span class='kw'>col</span> <span class='kw'>=</span> <span class='st'>"magenta"</span>),
  <span class='kw'>vars.ltext.args</span> <span class='kw'>=</span> <span class='fu'>list</span>(<span class='kw'>col</span> <span class='kw'>=</span> <span class='st'>"black"</span>,<span class='kw'>pos</span> <span class='kw'>=</span> <span class='fl'>4</span>,<span class='kw'>cex</span> <span class='kw'>=</span> <span class='fl'>0.5</span>), <span class='no'>...</span>)</pre>
    
    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2>
    <table class="ref-arguments">
    <colgroup><col class="name" /><col class="desc" /></colgroup>
    <tr>
      <th>x</th>
      <td><p>Output of function <code><a href='varbvs.html'>varbvs</a></code>.</p></td>
    </tr>
    <tr>
      <th>score</th>
      <td><p>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 <code>x$logw</code> as (unnormalized) log-marginal
  probabilities. As alternative, set <code>score</code> to the posterior
  inclusion probabilities that ignore correlations, using
  <code><a href='varbvsindep.html'>varbvsindep</a></code>.</p></td>
    </tr>
    <tr>
      <th>groups</th>
      <td><p>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.</p></td>
    </tr>
    <tr>
      <th>vars</th>
      <td><p>Indices (type <code>integer</code>) or names (type
  <code>character</code>) of variables to highlight and label. By default,
  <code>vars = NULL</code>, meaning no variables are highlighted.</p></td>
    </tr>
    <tr>
      <th>var.labels</th>
      <td><p>Labels to accompany the highlighted variables
  only. If missing, labels are retrieved from <code>x</code>. If
  <code>var.labels = NULL</code>, no labels are plotted.</p></td>
    </tr>
    <tr>
      <th>draw.threshold</th>
      <td><p>Plot a horizontal line at this location on the
  vertical axis.</p></td>
    </tr>
    <tr>
      <th>gap</th>
      <td><p>Amount of space to leave between each group of variables in
  the plot.</p></td>
    </tr>
    <tr>
      <th>col</th>
      <td><p>Argument passed to <code>xyplot</code> specifying color of points.</p></td>
    </tr>
    <tr>
      <th>pch</th>
      <td><p>Argument passed to <code>xyplot</code> specifying symbol type.</p></td>
    </tr>
    <tr>
      <th>scales</th>
      <td><p>Argument passed to <code>xyplot</code> specifying how x- and
  y-axes are drawn.</p></td>
    </tr>
    <tr>
      <th>xlab</th>
      <td><p>Argument passed to <code>xyplot</code> specifying horizontal
  axis title.</p></td>
    </tr>
    <tr>
      <th>ylab</th>
      <td><p>Argument passed to <code>xyplot</code> specifying 
  vertical axis title.</p></td>
    </tr>
    <tr>
      <th>abline.args</th>
      <td><p>Additional arguments passed to <code>panel.abline</code>
  specifying how to draw the horizontal line at the location specified
  by <code>draw.threshold</code>.</p></td>
    </tr>
    <tr>
      <th>vars.xyplot.args</th>
      <td><p>Additional arguments passed to <code>xyplot</code>
  for drawing the highlighted variables.</p></td>
    </tr>
    <tr>
      <th>vars.ltext.args</th>
      <td><p>Additional arguments passed to <code>ltext</code> for
  specifying how the labels of the highlighted variables are drawn in
  the plot.</p></td>
    </tr>
    <tr>
      <th>...</th>
      <td><p>Additional arguments passed to <code>xyplot</code> for drawing
    the un-highlighted variables.</p></td>
    </tr>
    </table>
    
    <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>

    <p>Note that <code>plot.varbvs</code> uses function <code>xyplot</code> from the
  <code>lattice</code> package, and <code>as.layer</code> from the
  <code>latticeExtra</code> package.</p>
    
    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>An object of class <code>"trellis"</code> generated by functions
  <code>xyplot</code> and <code>as.layer</code>.</p>
    
    <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>

    <p>P. Carbonetto and M. Stephens (2012). Scalable variational
inference for Bayesian variable selection in regression, and its
accuracy in genetic association studies. <em>Bayesian Analysis</em>
<b>7</b>, 73--108.</p>
    
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <p><code><a href='http://www.rdocumentation.org/packages/lattice/topics/xyplot'>xyplot</a></code>, <code><a href='http://www.rdocumentation.org/packages/lattice/topics/llines'>ltext</a></code>,
  <code><a href='http://www.rdocumentation.org/packages/lattice/topics/panel.functions'>panel.abline</a></code>, <code><a href='varbvs.html'>varbvs</a></code>,
  <code><a href='summary.varbvs.html'>summary.varbvs</a></code>, <code><a href='varbvsindep.html'>varbvsindep</a></code></p>
    

  </div>
  <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
    <h2>Contents</h2>
    <ul class="nav nav-pills nav-stacked">
      <li><a href="#arguments">Arguments</a></li>
      
      <li><a href="#details">Details</a></li>

      <li><a href="#value">Value</a></li>

      <li><a href="#references">References</a></li>

      <li><a href="#see-also">See also</a></li>
          </ul>

    <h2>Author</h2>
    Peter Carbonetto <a href='mailto:peter.carbonetto@gmail.com'>peter.carbonetto@gmail.com</a>
  </div>
</div>

      <footer>
      <div class="copyright">
  <p>Developed by Peter Carbonetto, Matthew Stephens, David Gerard.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p>
</div>

      </footer>
   </div>

  </body>
</html>
