niche.tests: Niche Equivalency and Background Similarity Test

bg.similarity.testR Documentation

Niche Equivalency and Background Similarity Test

Description

Hypothesis testing as proposed by \insertCitewarrenturelli2008;textualphyloclim 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 chance.

Usage

bg.similarity.test(
  p,
  env,
  n = 99,
  study.area.y = "mcp",
  conf.level = 0.95,
  app,
  dir
)

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

## S3 method for class 'ntest'
plot(x, ...)

## S3 method for class 'ntest'
print(x, ...)

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 and latitude (see SWD-formatted (=Samples-With-Data) files in the MAXENT tutorial).

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).

study.area.y

Defines the study area of the second species Y (see Warren et al. 2008). Can be "env" (study area corresponds to env) or "mcp" (study area is the area of a convex hull around the presence points of the second species Y).

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 dir is left empty the data will be written to a temporary directory, which will be deleted after execution.

x

An object of class ntest.

...

Further arguments passed to or from other methods.

Details

An installation of MAXENT \insertCitephillipsdudik2008phyloclim 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".

Value

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 set of random presence points from the study area of the second species

ci.y.randomX

Confidence interval for D and I based on the comparison of the second species against a set of random presence points from the study area of the first species

nd.x.randomY

Null distributions of D and I calculated from the comparison of the first species against a set of random presence points from the study area of the second species

nd.y.randomX

Null distributions of D and I calculated from the comparison of the second species against a set of random presence points from the study area of the first species

Note

These functions have been tested with MAXENT 3.3.4

References

\insertRef

phillipsdudik2008phyloclim

MAXENT webseite: https://biodiversityinformatics.amnh.org/open_source/maxent/

\insertRef

warrenturelli2008phyloclim

\insertRef

warrenseifert2011phyloclim

Examples

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

# 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
# --------------------
## Not run: 
  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)")
  }

## End(Not run)

heibl/phyloclim documentation built on April 23, 2024, 2:39 a.m.