twinstim_epitest {surveillance} | R Documentation |
"twinstim"
The function epitest
takes an epidemic "twinstim"
model
(with homogeneous infectivity of events, i.e., epidemic = ~1
),
and tests if the spatio-temporal interaction invoked by the epidemic
model component is statistically significant. A permutation test is
performed by default, which is only valid if the endemic intensity is
space-time separable.
The approach is described in detail in Meyer et al. (2016),
where it is also compared to alternative global tests for clustering
such as the knox
test.
epitest(model, data, tiles, method = "time", B = 199, eps.s = NULL, eps.t = NULL, fixed = NULL, verbose = TRUE, compress = FALSE, ...) ## S3 method for class 'epitest' coef(object, which = c("m1", "m0"), ...) ## S3 method for class 'epitest' plot(x, teststat = c("simpleR0", "D"), ...)
model |
a simple epidemic |
data |
an object of class |
tiles |
(only used by |
method |
one of the following character strings specifying the test method:
|
B |
the number of permutations for the Monte Carlo approach.
The default number is rather low; if computationally feasible,
|
eps.s,eps.t |
arguments for |
fixed |
optional character vector naming parameters to fix at their original
value when re-fitting the |
verbose |
the amount of tracing in the range |
compress |
logical indicating if the |
... |
further arguments for |
object,x |
an object of class |
which |
a character string indicating either the full ( |
teststat |
a character string determining the test statistic to plot, either
|
The test statistic is the reproduction number simpleR0
.
A likelihood ratio test of the supplied epidemic model against
the corresponding endemic-only model is also available.
By default, the null distribution of the test statistic under no
space-time interaction is obtained by a Monte Carlo permutation
approach (via permute.epidataCS
) and therefore relies on
a space-time separable endemic model component.
The plot
-method shows a truehist
of
the simulated null distribution together with the observed value.
The coef
-method extracts the parameter estimates from the B
permfits
(by default for the full model which = "m1"
).
a list (inheriting from "htest"
) with the following components:
method |
a character string indicating the type of test performed. |
data.name |
a character string giving the supplied |
statistic |
the observed test statistic. |
parameter |
the (effective) number of permutations used to calculate the p-value (only those with convergent fits are used). |
p.value |
the p-value for the test. For the |
In addition, if method != "LRT"
, the result will have the
following elements:
permfits |
the list of model fits (endemic-only and epidemic)
from the |
permstats |
a data frame with |
The plot
-method invisibly returns NULL
.
The coef
-method returns the B
x length(coef(model))
matrix of parameter estimates.
Sebastian Meyer
Meyer, S., Warnke, I., Rössler, W. and Held, L. (2016): Model-based testing for space-time interaction using point processes: An application to psychiatric hospital admissions in an urban area. Spatial and Spatio-temporal Epidemiology, 17, 15-25. doi: 10.1016/j.sste.2016.03.002. Eprint: http://arxiv.org/abs/1512.09052.
data("imdepi", "imdepifit") ## test for space-time interaction of the B-cases ## assuming spatial interaction to be constant within 50 km imdepiB50 <- update(subset(imdepi, type == "B"), eps.s = 50) imdfitB50 <- update(imdepifit, data = imdepiB50, epidemic = ~1, epilink = "identity", siaf = NULL, start = c("e.(Intercept)" = 0)) ## simple likelihood ratio test epitest(imdfitB50, imdepiB50, method = "LRT") ## permutation test (only a few permutations for speed) et <- epitest(imdfitB50, imdepiB50, B = 3 + 26*surveillance.options("allExamples"), verbose = 2 * (.Platform$OS.type == "unix"), .seed = 1, .parallel = 1 + surveillance.options("allExamples")) et plot(et) ## evidence against the null hypothesis of no space-time interaction summary(coef(et, which = "m1"))