View source: R/tango.weights.R
tango.weights | R Documentation |
tango.test
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.
tango.weights(coords, kappa = 1, longlat = FALSE, type = "basic", pop = NULL)
dweights(coords, kappa = 1, longlat = FALSE, type = "basic", pop = NULL)
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. |
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)
.
Returns an n \times n
matrix of weights.
Joshua French
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
tango.test
data(nydf)
coords <- as.matrix(nydf[, c("longitude", "latitude")])
w <- tango.weights(coords, kappa = 1, longlat = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.