Skip to contents

\(J_{rr}\) counts joins between two units of colour r and \(J_{rs}\) (r after s) joins between colours r and s, each as half the weight sum over ordered pairs; Jtot sums the different-colour joins. Expectations and variances are the nonfree sampling moments of Cliff and Ord (1981, pp. 19-20), exactly as spdep::joincount.multi (N counts the units with neighbours); deviates are (J - E) / sqrt(Var). Colours are the sorted distinct labels.

Usage

JoinCountMulti(labels, W)

Arguments

labels

Colour of each unit.

W

Spatial weights matrix; the diagonal is ignored.

Value

List with rows, joincount, expected, variance, z, levels.

References

Cliff, A. D. and Ord, J. K. (1981). Spatial Processes: Models and Applications. Pion, London.

Examples

W <- 1 * (abs(outer(1:9, 1:9, "-")) == 1)
JoinCountMulti(strsplit("aabbbccaa", "")[[1]], W)$joincount
#> [1] 2 2 1 1 1 1 3