<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
  <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>Phylogenetic uncertainty - Phylogenetic signal — tree_physig • sensiPhy</title>


<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />


<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>

<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/all.min.css" integrity="sha256-nAmazAk6vS34Xqo0BSrTb+abbtFlgsFK7NKSi6o7Y78=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.7.1/css/v4-shims.min.css" integrity="sha256-6qHlizsOWFskGlwVOKuns+D1nB6ssZrHQrNj1wGplHc=" crossorigin="anonymous" />

<!-- clipboard.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>

<!-- headroom.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/headroom.min.js" integrity="sha256-DJFC1kqIhelURkuza0AvYal5RxMtpzLjFhsnVIeuk+U=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.4/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>

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




<meta property="og:title" content="Phylogenetic uncertainty - Phylogenetic signal — tree_physig" />
<meta property="og:description" content="Performs phylogenetic signal estimates evaluating
uncertainty in trees topology." />
<meta name="twitter:card" content="summary" />




<!-- mathjax -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></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" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="../index.html">sensiPhy</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.8.5</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="../index.html">
    <span class="fas fa fas fa-home fa-lg"></span>
     
  </a>
</li>
<li>
  <a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
    <li>
      <a href="../articles/sensiPhy_vignette.html">sensiPhy: R-package for sensitivity analysis in phylogenetic comparative methods.</a>
    </li>
  </ul>
</li>
<li>
  <a href="../news/index.html">Changelog</a>
</li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="https://github.com/paternogbc/sensiPhy">
    <span class="fab fa fab 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>Phylogenetic uncertainty - Phylogenetic signal</h1>
    <small class="dont-index">Source: <a href='https://github.com/paternogbc/sensiPhy/blob/master/R/tree_physig.R'><code>R/tree_physig.R</code></a></small>
    <div class="hidden name"><code>tree_physig.Rd</code></div>
    </div>

    <div class="ref-description">
    <p>Performs phylogenetic signal estimates evaluating
uncertainty in trees topology.</p>
    </div>

    <pre class="usage"><span class='fu'>tree_physig</span>(
  <span class='no'>trait.col</span>,
  <span class='no'>data</span>,
  <span class='no'>phy</span>,
  <span class='kw'>n.tree</span> <span class='kw'>=</span> <span class='st'>"all"</span>,
  <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"K"</span>,
  <span class='kw'>track</span> <span class='kw'>=</span> <span class='fl'>TRUE</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>trait.col</th>
      <td><p>The name of a column in the provided data frame with trait 
to be analyzed  (e.g. "Body_mass").</p></td>
    </tr>
    <tr>
      <th>data</th>
      <td><p>Data frame containing species traits with row names matching tips
in <code>phy</code>.</p></td>
    </tr>
    <tr>
      <th>phy</th>
      <td><p>A phylogeny (class 'phylo') matching <code>data</code>.</p></td>
    </tr>
    <tr>
      <th>n.tree</th>
      <td><p>Number of times to repeat the analysis with n different trees picked 
randomly in the multiPhylo file. (If <code>n.tree</code> = "all", phylogenetic signal will be estimated
among the all set of trees provided in <code>phy</code>)</p></td>
    </tr>
    <tr>
      <th>method</th>
      <td><p>Method to compute signal: can be "K" or "lambda".</p></td>
    </tr>
    <tr>
      <th>track</th>
      <td><p>Print a report tracking function progress (default = TRUE)</p></td>
    </tr>
    <tr>
      <th>...</th>
      <td><p>Further arguments to be passed to <code>phylosig</code></p></td>
    </tr>
    </table>

    <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>

    <p>The function <code>tree_physig</code> returns a list with the following
components:</p>
<p><code>Trait</code>: Column name of the trait analysed</p>
<p><code>data</code>: Original full dataset</p>
<p><code>tree.physig.estimates</code>: Three number, phylogenetic signal estimate 
(lambda or K) and the p-value for each run with a different phylogenetic tree.</p>
<p><code>N.obs</code>: Size of the dataset after matching it with tree tips and removing NA's.</p>
<p><code>stats</code>: Main statistics for phylogenetic estimates.<code>CI_low</code> and <code>CI_high</code> are the lower 
and upper limits of the 95<!-- % confidence interval. --></p>
    <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>

    <p>This function estimates phylogenetic signal using <code><a href='https://rdrr.io/pkg/phytools/man/phylosig.html'>phylosig</a></code>
to n trees, randomly picked in a multiPhylo file.</p>
<p>Output can be visualised using <code>sensi_plot</code>.</p>
    <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>

    <p>The argument "se" from <code><a href='https://rdrr.io/pkg/phytools/man/phylosig.html'>phylosig</a></code> is not available in this function. Use the 
argument "V" instead with <code><a href='intra_physig.html'>intra_physig</a></code> to indicate the name of the column containing the standard 
deviation or the standard error of the trait variable instead.</p>
    <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>

    <p>Paterno, G. B., Penone, C. Werner, G. D. A. 
<a href='http://doi.wiley.com/10.1111/2041-210X.12990'>sensiPhy: 
An r-package for sensitivity analysis in phylogenetic 
comparative methods.</a> Methods in Ecology and Evolution 
2018, 9(6):1461-1467</p>
<p>Donoghue, M.J. &amp; Ackerly, D.D. (1996). Phylogenetic Uncertainties and 
Sensitivity Analyses in Comparative Biology. Philosophical Transactions:
 Biological Sciences, pp. 1241-1249.</p> 
<p>Blomberg, S. P., T. Garland Jr., A. R. Ives (2003) 
Testing for phylogenetic signal in comparative data: 
Behavioral traits are more labile. Evolution, 57, 717-745.</p>
<p>Pagel, M. (1999) Inferring the historical patterns of biological evolution. 
Nature, 401, 877-884.</p>
<p>Kamilar, J. M., &amp; Cooper, N. (2013). Phylogenetic signal in primate behaviour,
 ecology and life history. Philosophical Transactions of the Royal Society 
 B: Biological Sciences, 368: 20120341.</p>
    <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>

    <div class='dont-index'><p><code><a href='https://rdrr.io/pkg/phytools/man/phylosig.html'>phylosig</a></code>, 
<code><a href='tree_phylm.html'>tree_phylm</a></code>,<code><a href='sensi_plot.html'>sensi_plot</a></code></p></div>

    <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
    <pre class="examples"><div class='input'><span class='co'># Load data:</span>
<span class='fu'><a href='https://rdrr.io/r/utils/data.html'>data</a></span>(<span class='no'>alien</span>)
<span class='no'>alien.data</span><span class='kw'>&lt;-</span><span class='no'>alien</span>$<span class='no'>data</span>
<span class='no'>alien.phy</span><span class='kw'>&lt;-</span><span class='no'>alien</span>$<span class='no'>phy</span>
<span class='co'># Logtransform data</span>
<span class='no'>alien.data</span>$<span class='no'>logMass</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/Log.html'>log</a></span>(<span class='no'>alien.data</span>$<span class='no'>adultMass</span>)
<span class='co'># Run sensitivity analysis:</span>
<span class='no'>tree</span> <span class='kw'>&lt;-</span> <span class='fu'>tree_physig</span>(<span class='kw'>trait.col</span> <span class='kw'>=</span> <span class='st'>"logMass"</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>alien.data</span>,
<span class='kw'>phy</span> <span class='kw'>=</span> <span class='no'>alien.phy</span>, <span class='kw'>n.tree</span> <span class='kw'>=</span> <span class='fl'>10</span>)</div><div class='output co'>#&gt; <span class='warning'>Warning: NA's in response or predictor, rows with NA's were removed</span></div><div class='output co'>#&gt; <span class='warning'>Warning: Some phylo tips do not match species in data (this can be due to NA removal) species were dropped from phylogeny or data</span></div><div class='output co'>#&gt; <span class='message'>Used dataset has  92  species that match data and phylogeny</span></div><div class='output co'>#&gt; 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |======================================================================| 100%</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span>(<span class='no'>tree</span>)</div><div class='output co'>#&gt; $Call
#&gt; tree_physig(trait.col = "logMass", data = alien.data, phy = alien.phy, 
#&gt;     n.tree = 10)
#&gt; 
#&gt; $Summary
#&gt;             mean  CI_low CI_high     min     max
#&gt; estimate 0.76469 0.55378 0.97560 0.14775 0.94925
#&gt; pval     0.00120 0.00075 0.00165 0.00100 0.00300
#&gt; </div><div class='input'><span class='fu'><a href='sensi_plot.html'>sensi_plot</a></span>(<span class='no'>tree</span>)</div><div class='img'><img src='tree_physig-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'><a href='sensi_plot.html'>sensi_plot</a></span>(<span class='no'>tree</span>, <span class='kw'>graphs</span> <span class='kw'>=</span> <span class='fl'>1</span>)</div><div class='output co'>#&gt; <span class='message'>`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</span></div><div class='img'><img src='tree_physig-2.png' alt='' width='700' height='433' /></div><div class='input'><span class='fu'><a href='sensi_plot.html'>sensi_plot</a></span>(<span class='no'>tree</span>, <span class='kw'>graphs</span> <span class='kw'>=</span> <span class='fl'>2</span>)</div><div class='output co'>#&gt; <span class='message'>`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</span></div><div class='img'><img src='tree_physig-3.png' alt='' width='700' height='433' /></div></pre>
  </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="#value">Value</a></li>
      <li><a href="#details">Details</a></li>
      <li><a href="#note">Note</a></li>
      <li><a href="#references">References</a></li>
      <li><a href="#see-also">See also</a></li>
      <li><a href="#examples">Examples</a></li>
    </ul>

    <h2>Author</h2>
    <p>Caterina Penone &amp; Gustavo Paterno</p>
  </div>
</div>


      <footer>
      <div class="copyright">
  <p>Developed by Gustavo Paterno, Gijsbert Werner, Caterina Penone.</p>
</div>

<div class="pkgdown">
  <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.4.1.</p>
</div>

      </footer>
   </div>

  


  </body>
</html>


