segregation.test(X, ...)## S3 method for class 'ppp':
segregation.test(X, \dots, nsim = 19,
permute = TRUE, verbose = TRUE, Xname)
"ppp"
with factor-valued marks).relrisk.ppp
to control the smoothing parameter or bandwidth selection.rlabel. If TRUE (the
default), randomisation is performed by randomly permuting the
labels of X. If FALSE, randomisation is performing
byX."htest" representing the result of the test.X.
The test statistic is
$$T = \sum_i \sum_m \left( \widehat p(m \mid x_i) - \overline p_m
\right)^2$$
where $\widehat p(m \mid x_i)$ is the
leave-one-out kernel smoothing estimate of the probability that the
$i$-th data point has type $m$, and
$\overline p_m$ is the average fraction of data points
which are of type $m$.
The statistic $T$ is evaluated for the data and
for nsim randomised versions of X, generated by
randomly permuting or resampling the marks.
Note that, by default, automatic bandwidth selection will be
performed separately for each randomised pattern. This computation
can be very time-consuming but is necessary for the test to be
valid in most conditions. A short-cut is to specify the value of
the smoothing bandwidth sigma as shown in the examples.Diggle, P.J., Zheng, P. and Durr, P. (2005) Non-parametric estimation of spatial segregation in a multivariate point process: bovine tuberculosis in Cornwall, UK. Applied Statistics 54, 645--658.
relrisksegregation.test(hyytiala, 5)
if(interactive()) segregation.test(hyytiala, hmin=0.05)Run the code above in your browser using DataLab