tango.weights {smerc} | R Documentation |
Distance-based weights for tango.test
Description
tango.weights
constructs a distance-based weights
matrix. The tango.weights
function can be used to
construct a weights matrix w
using the method of
Tango (1995), Rogerson (1999), or a basic style.
Usage
tango.weights(coords, kappa = 1, longlat = FALSE, type = "basic", pop = NULL)
dweights(coords, kappa = 1, longlat = FALSE, type = "basic", pop = NULL)
Arguments
coords |
An |
kappa |
A positive constant related to strength of spatial autocorrelation. |
longlat |
The default is |
type |
The type of weights matrix to construct.
Current options are |
pop |
The population size associated with each region. |
Details
coords
is used to construct an n \times n
distance matrix d
.
If type = "basic"
, then w_{ij} =
exp(-d_{ij}/\kappa)
.
If type = "rogerson"
, then w_{ij} =
exp(-d_{ij}/\kappa)/\sqrt(pop_i/pop * pop_j/pop)
.
If type = "tango"
, then w_{ij} = exp(-4 *
d_{ij}^2/\kappa^2)
.
Value
Returns an n \times n
matrix of weights.
Author(s)
Joshua French
References
Tango, T. (1995) A class of tests for detecting "general" and "focused" clustering of rare diseases. Statistics in Medicine. 14:2323-2334.
Rogerson, P. (1999) The Detection of Clusters Using A Spatial Version of the Chi-Square Goodness-of-fit Test. Geographical Analysis. 31:130-147
See Also
Examples
data(nydf)
coords <- as.matrix(nydf[, c("longitude", "latitude")])
w <- tango.weights(coords, kappa = 1, longlat = TRUE)