R/influ_Discrete.R
influ_discrete.Rd
Fits models for trait evolution of discrete (binary) characters, detecting influential species.
influ_discrete( data, phy, model, transform = "none", bounds = list(), cutoff = 2, n.cores = NULL, track = TRUE, ... )
data | Data vector for a single binary trait, with names matching tips in |
---|---|
phy | A phylogeny (class 'phylo') matching |
model | The Mkn model to use (see Details). |
transform | The evolutionary model to transform the tree (see Details). Default is |
bounds | settings to constrain parameter estimates. See |
cutoff | The cut-off parameter for influential species (see Details). |
n.cores | number of cores to use. If 'NULL', number of cores is detected. |
track | Print a report tracking function progress (default = TRUE) |
... | Further arguments to be passed to |
The function tree_discrete
returns a list with the following
components:
call
: The function call
cutoff
: The value selected for cutoff
data
: The original full data vector
optpar
: Transformation parameter used (e.g. lambda
, kappa
etc.)
full.model.estimates
: Parameter estimates (transition rates q12 and q21),
AICc and the optimised value of the phylogenetic transformation parameter (e.g. lambda
)
for the full model.
influential_species
: List of influential species, based on standardised
difference in estimates for q12 and q21. Species are ordered from most influential to
less influential and only include species with a standardised difference > cutoff
.
sensi.estimates
: Parameter estimates (transition rates q12 and q21),,(percentual) difference
in parameter estimate compared to the full model (DIFq12, sigsq.q12,sDIFq12, DIFq21, optpar.q21,sDIFq21),
AICc and the optimised value of the phylogenetic transformation parameter (e.g. lambda
)
for each analysis with a species deleted.
This function sequentially removes one species at a time,
fits a model of discrete character evolution using fitDiscrete
,
stores the results and calculates the effects on model parameters. Currently, only
binary discrete traits are supported.
influ_discrete
detects influential species based on the standardised
difference in q12 or q21 when removing a given species compared
to the full model including all species. Species with a standardised difference
above the value of cutoff
are identified as influential.
Different character model from fitDiscrete
can be used, including ER
(equal-rates),
SYM
(symmetric), ARD
(all-rates-different) and meristic
(stepwise fashion).
Different transformations to the phylogenetic tree from fitDiscrete
can be used, i.e. none
,
EB
, lambda
, kappa
anddelta
.
See fitDiscrete
for more details on character models and tree transformations.
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.
Yang Z. 2006. Computational Molecular Evolution. Oxford University Press: Oxford.
Harmon Luke J, Jason T Weir, Chad D Brock, Richard E Glor, and Wendell Challenger. 2008. GEIGER: investigating evolutionary radiations. Bioinformatics 24:129-131.
if (FALSE) { #Load data: data("primates") #Create a binary trait factor adultMass_binary<-ifelse(primates$data$adultMass > 7350, "big", "small") adultMass_binary<-as.factor(as.factor(adultMass_binary)) names(adultMass_binary)<-rownames(primates$data) #Model trait evolution accounting for influential species influ_binary<-influ_discrete(data = adultMass_binary,phy = primates$phy[[1]], model = "SYM",transform = "none",cutoff = 2,n.cores = 2,track = TRUE) #Print summary statistics summary(influ_binary) sensi_plot(influ_binary) #q12 and q21 are, as expected, exactly the same in symmetrical model. #Use a different evolutionary model. influ_binary2<-influ_discrete(data = adultMass_binary,phy = primates$phy[[1]], model = "SYM",transform = "delta",n.cores = 2,track = TRUE) summary(influ_binary2) sensi_plot(influ_binary2) #Or change the cutoff and transformation influ_binary3<-influ_discrete(data = adultMass_binary,phy = primates$phy[[1]], model = "ARD",transform = "none",cutoff = 1.2,n.cores = 2,track = TRUE) summary(influ_binary3) sensi_plot(influ_binary3) }