Description Usage Arguments Value Note Author(s) References See Also Examples
Given temporal and spatial distances as well as corresponding critical
thresholds defining what “close” means, the function
knox
performs Knox (1963, 1964) test for space-time interaction.
The corresponding p-value can be calculated either by the Poisson
approximation or by a Monte Carlo permutation approach (Mantel, 1967)
with support for parallel computation via plapply
.
There is a simple plot
-method showing a truehist
of
the simulated null distribution together with the expected and observed
values.
1 2 3 4 |
dt,ds |
numeric vectors of length n*(n-1)/2 containing the pairwise
temporal and spatial distances of n events.
Logical vectors indicating temporal/spatial closeness may also be
supplied, in which case |
eps.t,eps.s |
Critical distances defining closeness in time and space, respectively. Distances lower than or equal to the critical distance are considered “"close"”. |
simulate.p.value |
logical indicating if a Monte Carlo permutation test should be
performed (as per default). Do not forget to set the
|
B |
number of permutations for the Monte Carlo approach. |
... |
arguments configuring |
x |
an object of class |
an object of class "knox"
(inheriting from "htest"
),
which is a list with the following components:
method |
a character string indicating the type of test performed, and whether the Poisson approximation or Monte Carlo simulation was used. |
data.name |
a character string giving the supplied |
statistic |
the number of close pairs. |
parameter |
if |
p.value |
the p-value for the test. In case
|
alternative |
the character string |
null.value |
the expected number of close pairs in the absence of space-time interaction. |
table |
the contingency table of |
The plot
-method invisibly returns NULL
.
The Poisson approximation works well if the proportions of close pairs in both time and space are small (Kulldorf and Hjalmars, 1999), otherwise the Monte Carlo permutation approach is recommended.
Sebastian Meyer
Knox, G. (1963): Detection of low intensity epidemicity: application to cleft lip and palate. British Journal of Preventive & Social Medicine, 17, 121-127.
Knox, E. G. (1964): The detection of space-time interactions. Journal of the Royal Statistical Society. Series C (Applied Statistics), 13, 25-30.
Kulldorff, M. and Hjalmars, U. (1999): The Knox method and other tests for space-time interaction. Biometrics, 55, 544-552.
Mantel, N. (1967): The detection of disease clustering and a generalized regression approach. Cancer Research, 27, 209-220.
the space-time K-function test stKtest
to combine information from different scales
eps.t
and eps.s
while also handling edge effects,
as well as function epitest
for testing
"twinstim"
models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data("imdepi")
imdepiB <- subset(imdepi, type == "B")
## Obtain the p-value via a Monte Carlo permutation test,
## where the permutations can be computed in parallel
## (using forking on Unix-alikes and a cluster on Windows, see ?plapply)
knoxtest <- knox(
dt = dist(imdepiB$events$time), eps.t = 30,
ds = dist(coordinates(imdepiB$events)), eps.s = 50,
simulate.p.value = TRUE, B = 199,
.parallel = 2, .seed = 1, .verbose = FALSE
)
knoxtest
plot(knoxtest)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.