Learn R Programming

spatstat.model (version 3.4-0)

dropply: Significance Tests for all Single Term Deletions from a Model

Description

Given a fitted point process model, consider dropping each possible term in the model, and apply a significance test for the dropped covariate.

Usage

dropply(object,
        action = c("berman.test", "cdf.test", "rhohat", "roc"),
        scope = NULL, ..., high = TRUE)

Value

A named list containing the results for each possible deletion.

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".

Arguments

object

A fitted point process model (object of class "ppm", "kppm", "dppm", "slrm" or "lppm").

action

Character string (partially matched) specifying the hypothesis test to be performed, or other calculation.

scope

A formula or a character vector specifying the model term or terms that are to be considered for deletion, or a fitted model obtained by deleting some terms from object. The default is to consider all possible terms.

high

Argument passed to roc to specify whether the ROC curves should be based on high or low values of the covariates, when action="roc". Either a logical value, or a logical vector of the same length as scope.

...

Other arguments passed to the relevant function roc, rhohat, berman.test or cdf.test. This includes arguments passed to as.mask to control the pixel resolution used for calculation.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Ege Rubak rubak@math.aau.dk and Suman Rakshit Suman.Rakshit@curtin.edu.au.

Details

This function is like drop1 in that it considers each possible term in the model object (or only the terms listed in the scope argument), deletes each such term from the model, 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 deleted covariate is computed using the updated model as a baseline.

action="berman.test":

One of Berman's tests is applied (see berman.test), using the updated model as the null hypothesis, and the original model as the alternative.

action="cdf.test":

One of the CDF tests is applied (see cdf.test), using the updated model as the null hypothesis, and the original model as the alternative.

action="rhohat":

taking the updated model as a baseline, the true intensity (ratio of true intensity to baseline intensity) is estimated as a function of the deleted covariate, using the function rhohat.

Note that dropply(model, "roc", ...) is equivalent to dropROC(model, ...).

References

Baddeley, A., Rubak, E., Rakshit, S. and Nair, G. (2025) ROC curves for spatial point patterns and presence-absence data. tools:::Rd_expr_doi("10.48550/arXiv.2506.03414").

See Also

dropROC, roc.ppm, rhohat, berman.test, cdf.test

Examples

Run this code
  dimyx <- if(interactive()) NULL else 32
  fut <- ppm(bei ~ grad + elev, data=bei.extra)
  z <- dropply(fut, "b", dimyx=dimyx)
  z
  plot(z, mar.panel=5)

  ## how to extract p-values from each test
  sapply(z, getElement, name="p.value")

Run the code above in your browser using DataLab