Learn R Programming

ecespa (version 1.1-1)

syrjala: Syrjala's test for the difference between the spatial distributions of two populations

Description

Computes a two-sample Cramer-von Mises (and Kolmogorov-Smirnov) type test for a difference between the spatial distributions of two populations. It is designed to be sensitive to differences in the way the populations are distributed across the study area but insensitive to differences in abundance between the two populations.

Usage

syrjala0(coords, var1, var2, nsim, R=FALSE)
syrjala(coords = NULL, var1 = NULL, var2 = NULL, nperm = 999)
syrjala.test(ppp1, ppp2, nsim = 999)
## S3 method for class 'syrjala.test':
plot(x, coline=1, ...)
## S3 method for class 'ecespa.syrjala':
plot(x, ...)

Arguments

coords
A data.frame with `$x` and `$y` components.
var1
The first numeric variable
var2
The second numeric variable.
nperm
Number of permutations.
nsim
Number of permutations.
R
Logical. Should be computed using R approach?
ppp1
A marked point pattern, with the ppp format of spatstat, representing the values of some parameter measured on the corresponding sampling locations.
ppp2
A marked point pattern, with the ppp format of spatstat, representing the values of some other parameter measured on the same locations than ppp1.
x
An object of class 'syrjala.test' or 'ecespa.syrjala' resulting from syrjala or syrjala.test, respectively.
coline
color for drawing the statistic's line in the plot.
...
Graphical parameters passed to hist.

Value

  • Functions syrjala or syrjala0 (with the argument R=FALSE) return an object of class 'syrjala.test'. Functions syrjala.test or syrjala0 (with the argument R=TRUE) return an object of class 'ecespa.syrjala'. In Both cases, the result is a list with the following elements:
  • cvm.obs(class syrjala.test). The observed (averaged) $psi$ statistic for the CvM test.
  • cvm.sim(class syrjala.test). A numeric vector with the nperm+1 simulated $psi$'s statistics (including cvm.obs).
  • ks.obs(class syrjala.test). The observed (averaged) $psi$ statistic for the K-S test.
  • ks.sim(class syrjala.test). A numeric vector with the nperm+1 simulated $psi$'s statistics (including ks.obs).
  • datanames(class syrjala.test). A character vector with the names of the two patterns, the spatial congruence of which is been analyzed.
  • nperm(class syrjala.test). The number of permutations employed in the test (not counting the original data).
  • psi.obs(class ecespa.syrjala).The observed (averaged) $psi$ statistic.
  • psi.sim(class ecespa.syrjala). A vector with the nsim simulated $psi$'s statistics.
  • datanames(class ecespa.syrjala). A vector with the names of the two point patterns whose spatial congruence is been analyzed.
  • nsim(class ecespa.syrjala). The number of permutations employed in the test.
  • Both S3 plot methods plot an histogram with the distribution of the simulated $psi$'s statistics and draws the observed $psi$ as a vertical line.

encoding

latin1

Warning

The test requires both populations being sampled in exactly the same sampling locations. Althoug this implementation employs ppp's as the supporting data format, this kind of data are not spatial point patterns. They cannot be analysed with the usual tools employed for marked point patterns.

Details

The null hypothesis of Syrjala's test is that across the study area, the normalized distributions of the two populations are the same (Syrjala, 1996). Population density data are collected at $K$ sampling locations on two populations. Let $(xk, yk)$ denote the coordinates of the $kth$ sampling location ($k= 1,...,K$ ); let $d.i(xk, yk)$ denote the sample density at the $Kth$ sampling location of the $ith$ population. To construct a test that is independent of the population sizes, the observed density data is first normalized: $$gamma.i(xk, yk) = di(xk, yk)/Di,$$ where $Di$ is the sum of $d.i(xk, yk)$ observations across the $K$ sampling locations. The value of the cumulative distribution function at the location $(xk, yk)$ for the $ith$ population, denoted $GAMMA.i(xk, yk)$, is the sum of all normalized density observations, $gamma.i(xk, yk)$, whose location $(x, y)$ is such that $x

References

Rey-Benayas, J.M., de la Monta�a, E., P�rez-Camacho, L., de la Cruz, M., Moreno, D., Parejo, J.L. and Su�rez-Seoane, S.{Rey-Benayas, J.M., de la Montana, E., Perez-Camacho, L., de la Cruz, M., Moreno, D., Parejo, J.L. and Suarez-Seoane, S.} 2008. Inter-annual dynamics and spatial congruence of a nocturnal bird assemblage inhabiting a Mediterranean agricultural mosaic. Submitted. Syrjala, S. E. 1996. A statistical test for a difference between the spatial distributions of two populations. Ecology 77: 75-80.

Examples

Run this code
data(syr1); data(syr2); data(syr3)
   
   plot(syrjala.test(syr1, syr2, nsim=999)) 
   
   plot(syrjala.test(syr1, syr3, nsim=999)) 
   
   
   coords <- data.frame(x=syr1$x, y=syr1$y); var1<- syr1$marks; var2<- syr2$marks
   
   syrjala(coords, var1, var2, 9999)
   
   syrjala0(coords, var1, var2, 9999)
   
   syrjala0(coords, var1, var2, 999, R=TRUE)
   
   
   coords <- expand.grid(x=1:10,y=1:10)
   var1 <- runif(100)
   var2 <- runif(100)
   syrjala(coords, var1, var2, 9999)

Run the code above in your browser using DataLab