kd
determines the difference in estimated K
functions for a set of cases and controls.
kd(
x,
case = 2,
r = NULL,
rmax = NULL,
breaks = NULL,
correction = c("border", "isotropic", "Ripley", "translate"),
nlarge = 3000,
domain = NULL,
var.approx = FALSE,
ratio = FALSE
)
Returns an fv
object. See documentation
for Kest
.
A ppp
object with marks for the case
and control groups.
The name of the desired "case" group in
levels(x$marks)
. Alternatively, the position of
the name of the "case" group in levels(x$marks)
.
Since we don't know the group names, the default is 2,
the second position of levels(x$marks)
.
x$marks
is assumed to be a factor. Automatic
conversion is attempted if it is not.
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
.
Optional. Maximum desired value of the argument \(r\).
This argument is for internal use only.
Optional. A character vector containing any selection of the
options "none"
, "border"
, "bord.modif"
,
"isotropic"
, "Ripley"
, "translate"
,
"translation"
, "rigid"
,
"none"
, "periodic"
, "good"
or "best"
.
It specifies the edge correction(s) to be applied.
Alternatively correction="all"
selects all options.
Optional. Efficiency threshold.
If the number of points exceeds nlarge
, then only the
border correction will be computed (by default), using a fast algorithm.
Optional. Calculations will be restricted
to this subset of the window. See Details of
Kest
.
Logical. If TRUE
, the approximate
variance of \(\hat K(r)\) under CSR
will also be computed.
Logical.
If TRUE
, the numerator and denominator of
each edge-corrected estimate will also be saved,
for use in analysing replicated point patterns.
Joshua French
This function relies internally on the
Kest
and
eval.fv
. The arguments are essentially
the same as the Kest
function,
and the user is referred there for more details about
the various arguments.
Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley.
Kest
,
eval.fv
data(grave)
kd = kd(grave)
plot(kd)
Run the code above in your browser using DataLab