The function begins by proposing a sample point within the region of observation. It then calculates and stores the distance from this point to the nearest event.
The process is repeated for the number of sample points specified by the user.
Based on the stored distances, and the input for lambda, the test statistic of sum from i=1 to n of [(pi*lambda*(x_i)^2)/(n)] is calculated.The test statistic serves as an alternative to that proposed by Clark and Evans (1954). Instead of comparing event-to-event distances, the function makes use of sample point-to-event distances.
Knowing that the test statistic follows a normal distribution of mean 1 and variance 1/n, it can be used in the calculation of a z-statistic to evaluate the hypothesis of complete spatial randomness.
In order for the selection of sample points to not bias the results, it is suggested that the function be run multiple times to obtain an average test statistic .
The test statistic should be used with caution as the function does not account for edge effects.
As points along the border will have larger nearest neighbor distances, the normal approximation of the test statistic will underestimate the mean distance.
When looking at event-to-point distances, it is expected that distances will be larger in a clustered process than in a process that exhibits complete spatial randomness.
While the event-to-point distance will be small if the random event happens to be located in a cluster, there is a high probability that the sample point will be located in a sparsely populated region and therefore have a large nearest neighbor distance.
By underestimating the mean distance, there is consequently more evidence to reject the null hypothesis of complete spatial randomness.
While the test statistic can provide a good first assessment of the null hypothesis of complete spatial randomness, it should not be relied upon as a definitive measure.
More accurate conclusions can likely be drawn by comparing the observed process to simulations of a random process generated over the specific region of observation.