Description Usage Arguments Details Value Note Author(s) References See Also Examples
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.
1 2 3 4 5 6 7 8 9 10 | niche.equivalency.test(p, env, n = 99, app, dir)
bg.similarity.test(p, env, n = 99, conf.level = .95, app, dir)
## S3 method for class 'ntest'
print(x, ...)
## S3 method for class 'ntest'
plot(x, ...)
|
p |
a |
env |
an object of class |
n |
an integer giving the number of permutations of the original data (default: |
conf.level |
a real number between 0 and 1 setting the confidence level of the confidence intervals to be calculated. |
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 |
x |
an object of class |
... |
further arguments passed to or from other methods. |
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 functions use the logistic output of MAXENT estimated using auto features.
By default, the environmental covariates given with env
are assumend to be continuous. In order to use categorical environmental covariates, you have to prepend "cat_"
to the layer name, e.g. "cat_landuse"
.
niche.equivalency.test
gives a list with six elements:
method |
name of the test. |
species |
names of the two species compared. |
null |
formulation of the null hypothesis. |
statistic |
statistics of niche overlap D based on Schoeners D and modified Hellinger distances. |
p.value |
p-values associated with the statistics. |
null.distribution |
null distributions of D and I derived from randomization. |
bg.similarity.test
gives a list with eight elements:
method |
name of the test. |
species |
names of the two species compared. |
null |
formulation of the null hypothesis. |
statistic |
statistics of niche overlap D based on Schoeners D and modified Hellinger distances. |
ci.x.randomY |
confidence interval for D and I based on the comparison of the first species against a randomized background derived from the second species. |
ci.y.randomX |
confidence interval for D and I based on the comparison of the second species against a randomized background derived from the first species. |
nd.x.randomY |
null distributions of D and I calculated from the comparison of the first species against a randomized background derived from the second species. |
nd.y.randomX |
null distributions of D and I calculated from the comparison of the second species against a randomized background derived from the first species. |
These functions have been completely rewritten and have been tested with MAXENT 3.3.3k
Christoph Heibl
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # 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, app = maxent.exe)
bst; plot(bst)
} else {
message("get a copy of MAXENT (see Details)")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.