Learn R Programming

spatstat.model (version 3.4-0)

addROC: ROC Curves for Single Term Additions to a Model

Description

Given a fitted point process model, consider adding new explanatory variables, and compute the ROC curve for each new variable.

Usage

addROC(object, scope, high=TRUE, ...)

Value

A named list containing the ROC curves for each new explanatory variable. The individual entries belong to class "fv", so they can be plotted. The list belongs to the class "anylist"

so it can be plotted in its entirety.

Arguments

object

A fitted point process model (object of class "ppm", "kppm", "dppm", "slrm" or "lppm") specifying the model to be extended.

scope

A formula or a character vector specifying the variable or variables to be considered for addition, or a fitted point process model containing all of these variables.

high

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

...

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 add1 in that it considers each possible term that could be added to the model object (or only the terms listed in the scope argument), adds each such term to the model, and measures the change in the model. In this case the change is measured by computing the ROC curve for the added covariate, using the original model object as a baseline.

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.

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

addapply, roc.ppm.

Examples

Run this code
  dimyx <- if(interactive()) NULL else 32
  fit0 <- ppm(bei ~ 1, data=bei.extra)

  z <- addROC(fit0, . ~ grad + elev, dimyx=dimyx)

  plot(z)

  ## how to compute AUC for each curve
  sapply(z, auc)

Run the code above in your browser using DataLab