Performs leave-one-out deletion analysis for phylogenetic logistic regression, and detects influential species while evaluating uncertainty in trees topology.
1 2 3 4 5 6 7 8 9 10
The model formula
Data frame containing species traits with row names matching tips
A phylogeny (class 'phylo') matching
Number of times to repeat the analysis with n different trees picked randomly in the multiPhylo file.
The cutoff value used to identify for influential species (see Details)
Bound on searching space. For details see
Print a report tracking function progress (default = TRUE)
Further arguments to be passed to
This function sequentially removes one species at a time, fits a phylogenetic
logistic regression model using
phyloglm, stores the
results and detects influential species. It repeats this operation using n trees,
randomly picked in a multiPhylo file.
Currently only logistic regression using the "logistic_MPLE"-method from
phyloglm is implemented.
influ_phyglm detects influential species based on the standardised
difference in intercept and/or slope 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. The default
value for the cutoff is 2 standardised differences change.
Currently, this function can only implement simple logistic models (i.e. trait~ predictor). In the future we will implement more complex models.
Output can be visualised using
influ_phyglm returns a list with the following
cutoff: The value selected for
formula: The formula
full.model.estimates: Coefficients, aic and the optimised
value of the phylogenetic parameter (i.e.
alpha) for the full model
without deleted species.
influential_species: List of influential species, both
based on standardised difference in interecept and in the slope of the
regression. Species are ordered from most influential to less influential and
only include species with a standardised difference >
sensi.estimates: A data frame with all simulation
estimates. Each row represents a deleted clade for a given random tree. Columns report the calculated
regression intercept (
intercept), difference between simulation
intercept and full model intercept (
DIFintercept), the standardised
sDIFintercept), the percentage of change in intercept compared
to the full model (
intercept.perc) and intercept p-value
pval.intercept). All these parameters are also reported for the regression
DIFestimate etc.). Additionally, model aic value (
the optimised value (
optpar) of the phylogenetic parameter
alpha) are reported.
data: Original full dataset.
errors: Species where deletion resulted in errors.
Gustavo Paterno, Caterina Penone & Gijsbert D.A. Werner
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
Ho, L. S. T. and Ane, C. 2014. "A linear-time algorithm for Gaussian and non-Gaussian trait evolution models". Systematic Biology 63(3):397-408.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
## Not run: # Simulate Data: set.seed(6987) mphy = rmtree(100, N = 30) x = rTrait(n=1,phy=mphy[]) X = cbind(rep(1,100),x) y = rbinTrait(n=1,phy=mphy[], beta=c(-1,0.5), alpha=.7 ,X=X) dat = data.frame(y, x) # Run sensitivity analysis: tree_influ <- tree_influ_phyglm(y ~ x, data = dat, phy = mphy, n.tree = 5) summary(tree_influ) sensi_plot(tree_influ) sensi_plot(tree_influ, graphs = 1) sensi_plot(tree_influ, graphs = 2) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.