Learn R Programming

smacpod (version 1.0.0)

kd.env: Envelopes for difference of estimated K functions

Description

kd.env determines envelopes for the difference in estimated K functions for a set of cases and controls. By default, produces the min/max envelopes. Additional confidence envelopes can be obtained using the confint function.

Usage

kd.env(x, case = 2, nsim = 99, r = NULL, breaks = NULL,
  correction = c("border", "isotropic", "Ripley", "translate"),
  nlarge = 3000, domain = NULL, var.approx = FALSE, ratio = FALSE)

Arguments

x
A ppp object from the spatstat package with marks for the case and control groups.
case
The position of the name of the "case" group in levels(x$marks). The default is 2.
nsim
The number of simulated data sets from which to construct the envelopes under the random labeling hypothesis.
r
Optional. Vector of values for the argument r at which K(r) should be evaluated. Users are advised not to specify this argument; there is a sensible default.
breaks
This argument is for internal use only.
correction
Optional. A character vector containing any selection of the options "none", "border", "bord.modif", "isotropic", "Ripley", "translate", "translation", "none", "good" or "best". It specifies the edge correction(s) to be applied.
nlarge
Optional. Efficiency threshold. If the number of points exceeds nlarge, then only the border correction will be computed (by default), using a fast algorithm.
domain
Optional. Calculations will be restricted to this subset of the window. See Details.
var.approx
Logical. If TRUE, the approximate variance of Kest(r) under CSR will also be computed.
ratio
Logical. If TRUE, the numerator and denominator of each edge-corrected estimate will also be saved, for use in analysing replicated point patterns.

Value

  • Returns an fv object. See documentation for envelope function in spatstat package. Can be plotted using plot.envelope. Additionall see plot.fv.

Details

This function relies internally on the Kest, eval.fv, and envelope.fv functions from the spatstat package. The arguments are essentially the same as the Kest function. See the documentation of the Kdest for more details about the various arguments.

References

Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley. Kulldorff, M. (1997) A spatial scan statistic. Communications in Statistics -- Theory and Methods 26, 1481-1496.

Examples

Run this code
data(grave)
env = kd.env(grave, nsim = 19)
plot(env, legend = FALSE, main = "")

Run the code above in your browser using DataLab