dmst.test | R Documentation |
dmst.test
implements the dynamic Minimum Spanning
Tree scan test of Assuncao et al. (2006). Starting with a
single region as a current zone, new candidate zones are
constructed by combining the current zone with the
connected region that maximizes the resulting likelihood
ratio test statistic. This procedure is repeated until
the population or distance upper bounds are reached. The
same procedure is repeated for each region. The clusters
returned are non-overlapping, ordered from most
significant to least significant. The first cluster is
the most likely to be a cluster. If no significant
clusters are found, then the most likely cluster is
returned (along with a warning).
dmst.test(
coords,
cases,
pop,
w,
ex = sum(cases)/sum(pop) * pop,
nsim = 499,
alpha = 0.1,
ubpop = 0.5,
ubd = 1,
longlat = FALSE,
cl = NULL
)
coords |
An |
cases |
The number of cases observed in each region. |
pop |
The population size associated with each region. |
w |
A binary spatial adjacency matrix for the regions. |
ex |
The expected number of cases for each region. The default is calculated under the constant risk hypothesis. |
nsim |
The number of simulations from which to compute the p-value. |
alpha |
The significance level to determine whether a cluster is signficant. Default is 0.10. |
ubpop |
The upperbound of the proportion of the total population to consider for a cluster. |
ubd |
A proportion in (0, 1]. The distance of
potential clusters must be no more than |
longlat |
The default is |
cl |
A cluster object created by |
The maximum intercentroid distance can be found by
executing the command:
gedist(as.matrix(coords), longlat = longlat)
,
based on the specified values of coords
and
longlat
.
Returns a smerc_cluster
object.
Joshua French
Assuncao, R.M., Costa, M.A., Tavares, A. and Neto, S.J.F. (2006). Fast detection of arbitrarily shaped disease clusters, Statistics in Medicine, 25, 723-742. <doi:10.1002/sim.2411>
print.smerc_cluster
,
summary.smerc_cluster
,
plot.smerc_cluster
,
scan.stat
, scan.test
data(nydf)
data(nyw)
coords <- with(nydf, cbind(longitude, latitude))
out <- dmst.test(
coords = coords, cases = floor(nydf$cases),
pop = nydf$pop, w = nyw,
alpha = 0.12, longlat = TRUE,
nsim = 2, ubpop = 0.05, ubd = 0.1
)
# better plotting
if (require("sf", quietly = TRUE)) {
data(nysf)
plot(st_geometry(nysf), col = color.clusters(out))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.