Learn R Programming

adehabitat (version 1.1-1)

biv.test: Bivariate Test

Description

biv.test displays the results of a bivariate randomisation test.

Usage

biv.test(dfxy, point, cbreaks = 8, h, colD = "blue", colP = "orange",
         o.include = FALSE, rem = NULL, ...)

Arguments

dfxy
a data frame with N lines (couples of values) and two columns
point
a vector of length 2, representing the observation to be compared with the simulated values of the randomisation test
cbreaks
a parameter used to define the numbers of breaks of the histograms. A larger value leads to a larger number of breaks
h
vector of bandwidths for x and y directions, used in the function kde2d of the package MASS. Defaults to normal reference bandwidth (see ?kde2d)
colD
a color used for the contours
colP
a color used for the observation
o.include
logical. If TRUE, the origin is included in the plot
rem
a character string to be inserted in the plot
...
further arguments passed to or from other methods

Warning

biv.test uses the function kde2d of the package MASS.

Details

biv.test is used to display the results of a bivariate randomisation test. An example of use of the function is provided in the function niche.test. The x-axis of the main window corresponds to the first column of dfxy; the y-axis corresponds to the second column. Kernel density is estimated to indicate the contours of the distribution of randomised values. The two marginal histograms correspond to the univariate tests on each axis, for which the p-values are computed with as.randtest (one-sided tests).

See Also

as.randtest, niche.test

Examples

Run this code
if (require(MASS)) {
  dfxy <- data.frame(x = rnorm(1000,5), y = rnorm(1000,5))
  p <- c(3.5, 3.5)
  biv.test(dfxy, p, rem = "Bivariate\nnormal distribution")
}

Run the code above in your browser using DataLab