[R-sig-Geo] spatstat kstest

Adrian.Baddeley at csiro.au Adrian.Baddeley at csiro.au
Mon Feb 11 06:56:42 CET 2013


On 02/08/2013 01:48 PM, Hiroshi Saito wrote:
>>> I am analyzing a spatial point data set.
>>> I would like to test how fit the model fitted by ppm is.
>>> For this objective, I used kstest.

This is a question about the 'spatstat' package.
Questions about this package should preferably be sent to the package authors.

>>> Unfortunately, however, I am not sure that the test actually tests the
>>> fit of the model for the data set on the two dimensional space.

Yes, it does.

>>> For example, if I set the covariate = x, it means (in my understanding)
>>> that the projection of the data set to the x-axis is tested.

That is correct.

In general, the Kolmogorov-Smirnov test compares the observed distribution of some numerical variable with the expected or theoretical distribution of the same variable.
 
To apply the K-S test to spatial data, each point in the data and each spatial location in the window must be assigned a numerical value. In 'kstest' this is specified by the argument 'covariate'. 

If you specify covariate="x" then the numerical value assigned to each point is its x-coordinate. Thus, effectively the data points are projected onto the x-axis. Then the observed distribution of these x-coordinates is compared with the theoretical distribution of the x-coordinate according to the fitted model. 

Another possible choice would be covariate = function(x,y){ 2 * x + y}.
More realistically, we would often have some other data in the form of a pixel image Z,
and we could then use covariate=Z.

The choice of covariate is arbitrary. Different choices of covariate lead to different tests, each of which is equally valid, and all of which have the same significance level (probability of type I error), but which will have different power (probability of type II error) depending on the true origin of the data. 

The appropriate choice of covariate depends on the *suspected* type of deviation from the null hypothesis.

regards
Adrian Baddeley

Prof Adrian Baddeley FAA
School of Earth and Environment
University of Western Australia
35 Stirling Hwy, Crawley WA 6009, Australia
          and 
CSIRO Mathematics, Informatics & Statistics
Leeuwin Centre, 65 Brockway Road, Floreat WA 6014, Australia
Tel: 08 9333 6177 | Fax: 08 9333 6121 | Skype: adrian.baddeley



More information about the R-sig-Geo mailing list