Learn R Programming

phyloclim (version 0.9-0)

hypothesis.testing: Niche Equivalency and Background Similarity Test

Description

Hypothesis testing as proposed by Warren et al. (2008) based on the generation of pseudoreplicate datasets. The niche equivalency (or identity) test asks whether the ecological niche models (ENMs) of two species are more different than expected if they were drawn from the same underlying distribution. The background similarity test asks whether ENMs drawn from populations with partially or entirely non-overlapping distributions are any more different from one another than expected by random chance.

Usage

niche.equivalency.test(p, env, n = 99, app, dir)

bg.similarity.test(p, env, n = 99, app, dir)

## S3 method for class 'ntest': print(x, \dots)

## S3 method for class 'ntest': plot(x, \dots)

Arguments

p
a SpatialPointsDataFrame or a simple data frame containing the presence points. In the latter case the first column contains the species names, the second and third column longitude
env
an object of class SpatialGridDataFrame containing the environmental covariates.
n
an integer giving the number of permutations of the original data (default: n = 99).
app
a character string giving the path to the MAXENT application.
dir
a character string giving the name of a directory where the input and output data for MAXENT will be saved. Already existing directories will be overwritten without a warning. If dir is left empty the data will be written to a temporar
x
an object of class ntest.
...
further arguments passed to or from other methods.

Value

  • niche.equivalency.test gives a list with six elements:
  • methodname of the test.
  • speciesnames of the two species compared.
  • nullformulation of the null hypothesis.
  • statisticstatistics of niche overlap D based on Schoeners D and modified Hellinger distances.
  • p.valuep-values associated with the statistics.
  • null.distributionnull distributions of D and I derived from randomization.
  • bg.similarity.test gives a list with eight elements:
  • methodname of the test.
  • speciesnames of the two species compared.
  • nullformulation of the null hypothesis.
  • statisticstatistics of niche overlap D based on Schoeners D and modified Hellinger distances.
  • ci.x.randomYconfidence interval for D and I based on the comparison of the first species against a randomized background derived from the second species.
  • ci.y.randomXconfidence interval for D and I based on the comparison of the second species against a randomized background derived from the first species.
  • nd.x.randomYnull distributions of D and I calculated from the comparison of the first species against a randomized background derived from the second species.
  • nd.y.randomXnull distributions of D and I calculated from the comparison of the second species against a randomized background derived from the first species.

Details

An installation of MAXENT (Phillips et al., 2006; http://www.cs.princeton.edu/~schapire/maxent/) is required in order to run niche.equivalency.test and bg.similarity.test. Both function use the logistic output of MAXENT estimated using auto features.

References

Phillips, S.J, M. Dudik, & R.E. Schapire. 2006. Maximum entropy modeling of species geographic distributions. Ecological Modeling 190: 231-259. Warren, D., R.E. Glor, & M. Turelli. 2008. Environmental niche equivalency versus conservatism: quantitative approaches to niche evolution. Evolution. 62: 2868-2883.

See Also

niche.overlap

Examples

Run this code
# path to MAXENT
# --------------
maxent.exe <- paste(system.file(package="dismo"), 
"/java/maxent.jar", sep = "")

# a data frame of coordinates where two species 
# have been detected ('presence points') and
# a raster stack of environmental covariables
# --------------------------------------
species <- c("enneaphylla", "laciniata")
data(sites)
samples <- sites[grep(paste(species, collapse = "|"), sites$spec), ]
data.path <- system.file("extdata", package = "phyloclim")
preds <- list.files(path = data.path, pattern = "[.]asc")
preds <- paste(data.path, preds, sep = "/")
preds <- stack(lapply(X = preds, FUN = raster))

# testing against 9 permutations of the data
# -------------------------------------------
reps <- 9

# run hypothesis tests
# --------------------
if (file.exists(maxent.exe)){
  net <- niche.equivalency.test(samples, preds, reps, maxent.exe)
  net; plot(net)
  bst <- bg.similarity.test(samples, preds, reps, maxent.exe)
  bst; plot(bst)
} else {
  message("get a copy of MAXENT (see Details)")
}

Run the code above in your browser using DataLab