kdest: Difference of estimated K functions

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/Kdest.R

Description

kdest determines the difference in estimated K functions for a set of cases and controls. Tolerance envelopes can also be produced.

Usage

1
2
3
4
kdest(x, case = 2, nsim = 0, level = 0.95, r = NULL, rmax = 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. x$marks is assumed to be a factor. Automatic conversion is attempted if it is not.

nsim

An non-negative integer. Default is 0. The difference in estimated K functions will be calculated for nsim data sets generated under the random labeling hypothesis. These will be used to construct the tolerance envelopes.

level

Level of tolerance envelopes. Ignored if nsim is 0.

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. If necessary, specify rmax.

rmax

Optional. Maximum desired value of the argument r.

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", "rigid", "none", "good" or "best". It specifies the edge correction(s) to be applied. Alternatively correction="all" selects all options.

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 of Kest.

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.

Details

This function relies internally on the Kest and eval.fv functions from the spatstat package. The arguments are essentially the same as the Kest function, and the user is referred there for more details about the various arguments.

Value

Returns a kdenv object. See documentation for spatstat::Kest.

Author(s)

Joshua French

References

Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley.

See Also

Kest, eval.fv

Examples

1
2
3
4
5
data(grave)
kd1 = kdest(grave)
plot(kd1, iso ~ r, ylab = "difference", legend = FALSE, main = "")
kd2 = kdest(grave, nsim = 9, level = 0.8)
plot(kd2)

smacpod documentation built on Jan. 26, 2018, 1 a.m.

Related to kdest in smacpod...