[R-sig-Geo] How to interpret the "residual" values in plot(quadrat.test(some_data_set))

Xiang Ye x|@ngye @end|ng |rom bu||@|o@edu
Wed Dec 20 06:56:19 CET 2023


Dear community,

I am recently digging into the quadrat test in library(spatstat). It is known that if you plot the result of quadrat.test, you will get three numbers in each grid: the observed number of points, the expected number of points assuming CSR holds, and the "residual".

For example:
library(spatstat)
plot(ponderosa, pch=16, cex=0.5, cols='grey50')
quadrat.test(ponderosa, 3, 4) -> a
plot(a, add=TRUE)

And you get:
[cid:16f82480-6395-4498-9ce8-742cbbd41660]

According to what I learnt about the quadrat test (Rogersson and Yamada 2005, p. 48), and the help document from quadrat.test, I assume the "residual" should be (observed-expected)^2/expected. However, the numbers in the above figure does not support my guess. Take the first grid as an example, in this grid 15 points are observed, with an expectation of 9. So the "residual" should be (15-9)^2/9=4, rather than 2.

Moreover, if you look at the 2nd, 3rd, and 5th grids, you will find that when the observed number of points is deviating from the expectation, the "residual" grows linearly rather than squarely, indicating there is no squared term in the numerator when calculating the "residual", letting alone the sum of them does not agree with the reported chi-squared statistic.

I will be grateful if someone can shed some light on how this "residual" calculated.
Thanks in advance!

叶翔 YE, Xiang
THINKING SPATIALLY<http://www.linkedin.com/in/spatialyexiang>.
Ph.D. in Spatial Statistics

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20231220/b037cf21/attachment.html>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 135941 bytes
Desc: image.png
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20231220/b037cf21/attachment.png>


More information about the R-sig-Geo mailing list