addapply {spatstat.model} | R Documentation |
Significance Tests or Effect Size for Single Term Additions to a Model
Description
Given a fitted point process model, consider adding new explanatory variables, and apply a significance test (or effect size calculation) for the effect of each new variable.
Usage
addapply(object,
action = c("berman.test", "cdf.test", "rhohat", "roc"),
scope,
..., high = TRUE)
Arguments
object |
A fitted point process model (object of class |
action |
Character string (partially matched) specifying the hypothesis test to be performed, or other calculation. |
scope |
A formula or a character vector specifying the variable or variables that are to be considered for addition, or a fitted point process model containing all these variables. |
high |
Argument passed to |
... |
Other arguments passed to the relevant function
|
Details
This function is like add1
in that it considers adding new terms to the model object
and measures the change in the model.
In this case the change is measured by performing the action
.
Options are:
action="roc"
:-
the ROC curve for the added covariate is computed using the original model
object
as a baseline. action="berman.test"
:-
One of Berman's tests is applied (see
berman.test
), using the original modelobject
as the null hypothesis, and the extended model as the alternative. action="cdf.test"
:-
One of the CDF tests is applied (see
cdf.test
), using the original modelobject
as the null hypothesis, and the extended model as the alternative. action="rhohat"
:-
taking the original model
object
as a baseline, the true intensity (ratio of true intensity to baseline intensity) is estimated as a function of the added explanatory variable, using the functionrhohat
.
Note that addapply(object, "roc", scope)
is equivalent to addROC(object, scope)
.
Either object
or scope
should be a fitted point process
model, and the other argument may be a fitted point process model or a
formula. If object
is a fitted model then scope
may be a
character vector of the names of variables to be added.
Value
A named list containing the results for each added variable.
The list belongs to the class "anylist"
so it can be printed and plotted in its entirety.
If action="roc"
the individual entries are
ROC curves belonging to class "fv"
.
If action="rhohat"
the individual entries are
curves belonging to class "fv"
and class "rhohat"
.
If action="berman.test"
the individual entries
are hypothesis tests of class "htest"
and "bermantest"
.
If action="cdf.test"
the individual entries
are hypothesis tests of class "htest"
and "cdftest"
.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Ege Rubak rubak@math.aau.dk and Suman Rakshit Suman.Rakshit@curtin.edu.au.
References
Baddeley, A., Rubak, E., Rakshit, S. and Nair, G. (2025) ROC curves for spatial point patterns and presence-absence data. doi:10.48550/arXiv.2506.03414.
See Also
addROC
,
dropROC
,
roc.ppm
,
rhohat
,
berman.test
,
cdf.test
Examples
dimyx <- if(interactive()) NULL else 32
fit0 <- ppm(bei ~ 1, data=bei.extra)
z <- addapply(fit0, "ber", . ~ grad+elev, dimyx=dimyx)
z
plot(z, mar.panel=5)
## how to extract p-values from each test
sapply(z, getElement, name="p.value")