Sensitivity Analysis Species Sampling - Phylogenetic Linear Regression

Share:

Description

Performs analyses of sensitivity to species sampling by randomly removing species and detecting the effects on parameter estimates in a phylogenetic linear regression.

Usage

1
2
samp_phylm(formula, data, phy, times = 30, breaks = seq(0.1, 0.5, 0.1),
  model = "lambda", track = TRUE, ...)

Arguments

formula

The model formula

data

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

phy

A phylogeny (class 'phylo') matching data.

times

The number of times species are randomly deleted for each break.

breaks

A vector containing the percentages of species to remove.

model

The phylogenetic model to use (see Details). Default is lambda.

track

Print a report tracking function progress (default = TRUE)

...

Further arguments to be passed to phylolm

Details

This function randomly removes a given percentage of species (controlled by breaks) from the full phylogenetic linear regression, fits a phylogenetic linear regression model without these species using phylolm, repeats this many times (controlled by times), stores the results and calculates the effects on model parameters.

All phylogenetic models from phylolm can be used, i.e. BM, OUfixedRoot, OUrandomRoot, lambda, kappa, delta, EB and trend. See ?phylolm for details.

Currently, this function can only implement simple linear models (i.e. trait~ predictor). In the future we will implement more complex models.

Output can be visualised using sensi_plot.

Value

The function samp_phylm returns a list with the following components:

formula: The formula

full.model.estimates: Coefficients, aic and the optimised value of the phylogenetic parameter (e.g. lambda or kappa) for the full model without deleted species.

samp.model.estimates: A data frame with all simulation estimates. Each row represents a model rerun with a given number of species n.remov removed, representing n.percent of the full dataset. Columns report the calculated regression intercept (intercept), difference between simulation intercept and full model intercept (DFintercept), 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 slope (DFslope etc.). Additionally, model aic value (AIC) and the optimised value (optpar) of the phylogenetic parameter (e.g. kappa or lambda, depending on the phylogenetic model used) are reported. Lastly we reported the standardised difference in intercept (sDFintercept) and slope (sDFslope).

sign.analysis For each break (i.e. each percentage of species removed) this reports the percentage of statistically signficant (at p<0.05) intercepts (perc.sign.intercept) over all repititions as well as the percentage of statisticaly significant (at p<0.05) slopes (perc.sign.slope).

data: Original full dataset. #' @note Please be aware that dropping species may reduce power to detect significant slopes/intercepts and may partially be responsible for a potential effect of species removal on p-values. Please also consult standardised differences in the (summary) output.

Author(s)

Gustavo Paterno & Gijsbert D.A. Werner

References

Werner, G.D.A., Cornwell, W.K., Sprent, J.I., Kattge, J. & Kiers, E.T. (2014). A single evolutionary innovation drives the deep evolution of symbiotic N2-fixation in angiosperms. Nature Communications, 5, 4087.

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.

See Also

phylolm, samp_phyglm, influ_phylm,sensi_plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Load data:
data(alien)
# Run analysis:
samp <- samp_phylm(log(gestaLen) ~ log(adultMass), phy = alien$phy[[1]], 
data = alien$data, times = 10)
summary(samp)
head(samp$samp.model.estimates)
# Visual diagnostics
## Not run: 
sensi_plot(samp)
# You can specify which graph and parameter ("slope" or "intercept") to print: 
sensi_plot(samp, graphs = 1, param = "slope")
sensi_plot(samp, graphs = 2, param = "intercept")

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.