Performs Phylogenetic signal estimates evaluating trait intraspecific variability

intra_physig(
  trait.col,
  data,
  phy,
  V = NULL,
  n.intra = 100,
  distrib = "normal",
  method = "K",
  track = TRUE
)

Arguments

trait.col

The name of a column in the provided data frame with trait to be analyzed (e.g. "Body_mass").

data

Data frame containing species traits with row names matching tips in phy.

phy

A phylogeny (class 'phylo', see ?ape).

V

Name of the column containing the standard deviation or the standard error of the trait variable. When information is not available for one taxon, the value can be 0 or NA.

n.intra

Number of times to repeat the analysis generating a random trait value. If NULL, n.intra = 30

distrib

A character string indicating which distribution to use to generate a random value for the response and/or predictor variables. Default is normal distribution: "normal" (function rnorm). Uniform distribution: "uniform" (runif) Warning: we recommend to use normal distribution with Vx or Vy = standard deviation of the mean.

method

Method to compute signal: can be "K" or "lambda".

track

Print a report tracking function progress (default = TRUE)

Value

The function intra_physig returns a list with the following components:

Trait: Column name of the trait analysed

data: Original full dataset

intra.physig.estimates: Run number, phylogenetic signal estimate (lambda or K) and the p-value for each run with a different simulated datset.

N.obs: Size of the dataset after matching it with tree tips and removing NA's.

stats: Main statistics for signal estimateCI_low and CI_high are the lower and upper limits of the 95

Details

This function estimates phylogenetic signal using phylosig. The analysis is repeated n.intra times. At each iteration the function generates a random value for each row in the dataset using the standard deviation or errors supplied and assuming a normal or uniform distribution. To calculate means and se for your raw data, you can use the summarySE function from the package Rmisc.

Output can be visualised using sensi_plot.

Note

The argument "se" from phylosig is not available in this function. Use the argument "V" instead with intra_physig to indicate the name of the column containing the standard deviation or the standard error of the trait variable instead.

References

Paterno, G. B., Penone, C. Werner, G. D. A. sensiPhy: An r-package for sensitivity analysis in phylogenetic comparative methods. Methods in Ecology and Evolution 2018, 9(6):1461-1467

Martinez, P. a., Zurano, J.P., Amado, T.F., Penone, C., Betancur-R, R., Bidau, C.J. & Jacobina, U.P. (2015). Chromosomal diversity in tropical reef fishes is related to body size and depth range. Molecular Phylogenetics and Evolution, 93, 1-4

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.

Pagel, M. (1999) Inferring the historical patterns of biological evolution. Nature, 401, 877-884.

Kamilar, J. M., & Cooper, N. (2013). Phylogenetic signal in primate behaviour, ecology and life history. Philosophical Transactions of the Royal Society B: Biological Sciences, 368: 20120341.

See also

Examples

if (FALSE) { data(alien) alien.data<-alien$data alien.phy<-alien$phy # Run sensitivity analysis: intra <- intra_physig(trait.col = "gestaLen", V = "SD_gesta" , data = alien.data, phy = alien.phy[[1]]) summary(intra) sensi_plot(intra) sensi_plot(intra, graphs = 1) sensi_plot(intra, graphs = 2) } # \dontshow{ data(alien) # Run sensitivity analysis: intra <- intra_physig(trait.col = "gestaLen", V = "SD_gesta" , data = alien.data, n.intra = 5, phy = alien.phy[[1]])
#> distrib = normal: make sure that standard deviation is provided for V
#> Warning: NA's in response or predictor, rows with NA's were removed
#> Warning: Some phylo tips do not match species in data (this can be due to NA removal) species were dropped from phylogeny or data
#> Used dataset has 85 species that match data and phylogeny
#> | | | 0% | |============== | 20% | |============================ | 40% | |========================================== | 60% | |======================================================== | 80% | |======================================================================| 100%
summary(intra)
#> $Call #> intra_physig(trait.col = "gestaLen", data = alien.data, phy = alien.phy[[1]], #> V = "SD_gesta", n.intra = 5) #> #> $Summary #> mean CI_low CI_high min max #> estimate 1.53822 1.24678 1.82966 1.33149 1.91947 #> pval 0.00100 0.00100 0.00100 0.00100 0.00100 #>
# }