anova.ppm {spatstat} | R Documentation |
Performs analysis of deviance for two or more fitted point process models.
## S3 method for class 'ppm' anova(object, ..., test=NULL, override=FALSE)
object |
A fitted point process model
(object of class |
... |
One or more fitted point process models. |
test |
Character string, partially matching one of
|
override |
Logical flag indicating whether to proceed even when there is no statistical theory to support the calculation. |
This is a method for anova
for
fitted point process models (objects of class "ppm"
,
usually generated by the model-fitting function ppm
).
If the fitted models are all Poisson point processes,
then this function performs an Analysis of Deviance of
the fitted models. The output shows the deviance differences
(i.e. 2 times log likelihood ratio),
the difference in degrees of freedom, and (if test="Chi"
)
the two-sided p-values for the chi-squared tests. Their interpretation
is very similar to that in anova.glm
.
If some of the fitted models are not Poisson point processes,
then there is no statistical theory available to support
a similar analysis. The function issues a warning,
and (by default) returns a NULL
value.
However if override=TRUE
,
then a kind of analysis of deviance table will be printed.
The ‘deviance’ differences in this table are equal to 2 times the differences
in the maximised values of the log pseudolikelihood (see
ppm
). At the time of writing, there is no statistical
theory to support inferential interpretation of log pseudolikelihood
ratios. The override
option is provided for research purposes
only!
An object of class "anova"
, or NULL
.
There may be an error message that the models are not “nested”.
For an Analysis of Deviance the models must be nested, i.e. one model
must be a special case of the other. For example the point process
model with formula ~x
is a special case of the model with
formula ~x+y
, so these models are nested. However
the two point process
models with formulae ~x
and ~y
are not nested.
If you get this error message and you believe that the models should be nested, the problem may be the inability of R to recognise that the two formulae are nested. Try modifying the formulae to make their relationship more obvious.
There may be an error message from anova.glmlist
that
“models were not all fitted to the same size of dataset”.
This implies that the models were fitted using different
quadrature schemes (see quadscheme
) and/or
with different edge corrections or different values of the
border edge correction distance rbord
.
To ensure that models are comparable, check the following:
the models must all have been fitted to the same point pattern dataset, in the same window.
all models must have been fitted by the same
fitting method as specified by the argument method
in
ppm
.
If some of the models depend on covariates, then
they should all have been fitted using the same list of
covariates, and using allcovar=TRUE
to ensure that the
same quadrature scheme is used.
all models must have been fitted using the same edge
correction as specified by the arguments correction
and rbord
. If you did not specify the value of
rbord
, then it may have
taken a different value for different models. The default value of
rbord
is equal to zero for a Poisson model,
and otherwise equals the reach (interaction distance) of the
interaction term (see reach
).
To ensure that the models are comparable, set rbord
to
equal the maximum reach of the interactions that you
are fitting.
Adrian Baddeley Adrian.Baddeley@csiro.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
data(swedishpines) mod0 <- ppm(swedishpines, ~1, Poisson()) modx <- ppm(swedishpines, ~x, Poisson()) anova(mod0, modx, test="Chi")