bn.test {smerc} | R Documentation |
Besag-Newell Test
Description
bn.test
implements the Besag-Newell test of Besag
and Newell (1991) for finding disease clusters.
Usage
bn.test(
coords,
cases,
pop,
cstar,
ex = sum(cases)/sum(pop) * pop,
alpha = 0.1,
longlat = FALSE,
modified = FALSE
)
Arguments
coords |
An |
cases |
The number of cases observed in each region. |
pop |
The population size associated with each region. |
cstar |
A non-negative integer indicating the minimum number of cases to include in each window. |
ex |
The expected number of cases for each region. The default is calculated under the constant risk hypothesis. |
alpha |
The significance level to determine whether a cluster is signficant. Default is 0.10. |
longlat |
The default is |
modified |
A logical value indicating whether a
modified version of the test should be performed. The
original paper recommends computing the p-value for
each cluster as |
Value
Returns a smerc_cluster
object.
Author(s)
Joshua French
References
Besag, J. and Newell, J. (1991). The detection of clusters in rare diseases, Journal of the Royal Statistical Society, Series A, 154, 327-333.
See Also
print.smerc_cluster
,
summary.smerc_cluster
,
plot.smerc_cluster
,
scan.test
Examples
data(nydf)
data(nyw)
coords <- with(nydf, cbind(x, y))
out <- bn.test(
coords = coords, cases = nydf$cases,
pop = nydf$pop, cstar = 6,
alpha = 0.1
)
plot(out)
# better plotting
if (require("sf", quietly = TRUE)) {
data(nysf)
plot(st_geometry(nysf), col = color.clusters(out))
}