Performs leave-one-out deletion analysis for phylogenetic signal estimates, and detects influential species for K or lambda.
influ_physig(trait.col, data, phy, method = "K", cutoff = 2, track = TRUE, ...)
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 | A phylogeny (class 'phylo') matching |
method | Method to compute signal: can be "K" or "lambda". |
cutoff | The cutoff value used to identify for influential species (see Details) |
track | Print a report tracking function progress (default = TRUE) |
... | Further arguments to be passed to |
The function influ_physig
returns a list with the following
components:
cutoff
: The value selected for cutoff
trait.col
: Column name of the trait analysed
full.data.estimates
: Phylogenetic signal estimate (K or lambda)
and the P value (for the full data).
influential_species
: List of influential species,
based on standardised difference in K or lambda.
Species are ordered from most influential to less influential and
only include species with a standardised difference > cutoff
.
influ.physig.estimates
: A data frame with all simulation
estimates. Each row represents a deleted species
Columns report the calculated signal estimate (k
) or (lambda
),
difference between signal estimation of the reduced and full data
(DF
), the percentage of change in signal compared
to the full data signal (perc
) and p-value for the phylogenetic signal
test (pval
)
data
: Original full dataset.
This function sequentially removes one species at a time, ans estimates phylogenetic
signal (K or lambda) using phylosig
, stores the
results and detects the most influential species.
influ_physig
detects influential species based on the standardised
difference in signal estimate (K or lambda) when removing a given species compared
to the full data estimate (with 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 in signal estimate.
Output can be visualised using sensi_plot
.
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.
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
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.
# \dontshow{ # Load data: data(alien) alien.data<-alien$data alien.phy<-alien$phy # Logtransform data alien.data$logMass <- log(alien.data$adultMass) # Run sensitivity analysis: influ <- influ_physig("logMass", data = alien.data[1:20,], phy = alien.phy[[1]])#> 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#>#> | | | 0% | |==== | 6% | |======== | 11% | |============ | 17% | |================ | 22% | |=================== | 28% | |======================= | 33% | |=========================== | 39% | |=============================== | 44% | |=================================== | 50% | |======================================= | 56% | |=========================================== | 61% | |=============================================== | 67% | |=================================================== | 72% | |====================================================== | 78% | |========================================================== | 83% | |============================================================== | 89% | |================================================================== | 94% | |======================================================================| 100%#> $`Full data estimate` #> Trait N.species K Pval #> 1 logMass 18 0.5144745 0.005 #> #> $`Influential species for K` #> [1] "Marmota_monax" #> #> $`Summary for K` #> Species removed K DF Change(%) Pval #> 1 Marmota_monax 0.7032771 0.1888026 36.7 0.001 #># } if (FALSE) { # Load data: data(alien) # Logtransform data alien.data$logMass <- log(alien.data$adultMass) # Run sensitivity analysis: influ <- influ_physig("logMass", data = alien.data, phy = alien.phy[[1]]) # To check summary results: summary(influ) # Most influential speciesL influ$influential.species # Visual diagnostics sensi_plot(influ) # You can specify which graph to print: sensi_plot(influ, graphs = 1) sensi_plot(influ, graphs = 2) }