This function performs a $\chi^2$ test of goodness-of-fit
to the Poisson point process (including Complete Spatial
Randomness but also inhomogeneous Poisson processes),
based on quadrat counts. If X
is a point pattern, it is taken as the data point pattern
for the test. If X
is a fitted point process model, then the
data to which this model was fitted are extracted from the model
object, and are treated as the data point pattern for the test.
The window of observation is divided into rectangular tiles
and the number of data points in each tile is counted,
as described in quadratcount
.
If fit
is absent, then we test the null hypothesis
that the data pattern is a realisation of Complete Spatial
Randomness (the uniform Poisson point process) by applying the
$\chi^2$ test of goodness-of-fit to the quadrat counts.
If fit
is present, then it should be a point process model
(object of class "ppm"
) and it should be a Poisson point
process. Then we test the null hypothesis
that the data pattern is a realisation of the (inhomogeneous) Poisson point
process specified by fit
. Again this is a
$\chi^2$ test of goodness-of-fit to the quadrat counts.
The return value is an object of class "htest"
.
Printing the object gives comprehensible output
about the outcome of the test. The return value also belongs to
the special class "quadrat.test"
. Plotting the object
will display the quadrats, annotated by their observed and expected
counts and the Pearson residuals. See the examples.
To test the Poisson point process against a specific alternative
point process model, use anova.ppm
.