Learn R Programming

spdep (version 0.2-3)

joincount.test: BB join count statistic for k-coloured factors

Description

The BB join count test for spatial autocorrelation using a spatial weights matrix in weights list form for testing whether same-colour joins occur more frequently than would be expected if the zones were labelled in a spatially random way. The assumptions underlying the test are sensitive to the form of the graph of neighbour relationships and other factors, and results may be checked against those of geary.mc permutations.

Usage

joincount.test(fx, listw, zero.policy=FALSE, alternative="greater",
 spChk=NULL)
print.jclist(x, ...)

Arguments

fx
a factor of the same length as the neighbours and weights objects in listw
listw
a listw object created for example by nb2listw
zero.policy
if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA
alternative
a character string specifying the alternative hypothesis, must be one of greater (default), less or two.sided.
spChk
should the data vector names be checked against the spatial objects for identity integrity, TRUE, or FALSE, default NULL to use get.spChkOption()
x
object to be printed
...
arguments to be passed through for printing

Value

  • A list with class jclist of lists with class htest for each of the k colours containing the following components:
  • statisticthe value of the standard deviate of the join count statistic.
  • p.valuethe p-value of the test.
  • estimatethe value of the observed statistic, its expectation and variance.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string giving the method used.
  • data.namea character string giving the name(s) of the data.

References

Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion, p. 20.

See Also

joincount, joincount.mc, listw2U

Examples

Run this code
data(oldcol)
HICRIME <- cut(COL.OLD$CRIME, breaks=c(0,35,80), labels=c("low","high"))
names(HICRIME) <- rownames(COL.OLD)
joincount.test(HICRIME, nb2listw(COL.nb, style="B"))
joincount.test(HICRIME, nb2listw(COL.nb, style="C"))
joincount.test(HICRIME, nb2listw(COL.nb, style="S"))
joincount.test(HICRIME, nb2listw(COL.nb, style="W"))
by(card(COL.nb), HICRIME, summary)
print(is.symmetric.nb(COL.nb))
COL.k4.nb <- knn2nb(knearneigh(coords.OLD, 4))
print(is.symmetric.nb(COL.k4.nb))
joincount.test(HICRIME, nb2listw(COL.k4.nb, style="B"))
cat("Note non-symmetric weights matrix - use listw2U()
")
joincount.test(HICRIME, listw2U(nb2listw(COL.k4.nb, style="B")))

Run the code above in your browser using DataLab