pysal

Previous topic

esda.geary — Geary’s C statistics for spatial autocorrelation

Next topic

esda.mapclassify — Choropleth map classification

This Page

esda.join_counts — Spatial autocorrelation statistics for binary attributes

New in version 1.0.

Spatial autocorrelation for binary attributes

class pysal.esda.join_counts.Join_Counts(y, w)

Binary Join Counts

Parameters:

y : array

binary variable measured across n spatial units

w : W

spatial weights instance

Examples

Replicate example from anselin and rey

>>> import numpy as np
>>> w=pysal.lat2W(4,4)
>>> y=np.ones(16)
>>> y[0:8]=0
>>> jc=Join_Counts(y,w)
>>> jc.bb
10.0
>>> jc.zbb
1.2060453783110545
>>> jc.bw
4.0
>>> jc.zbw
-3.2659863237109046
>>> jc.Ebw
12.0
>>> jc.bw
4.0
>>> jc.Vbw
6.0
>>> np.sqrt(jc.Vbw)
2.4494897427831779
>>> 

Attributes

y array original variable
w W original w object
bb float number of black-black joins
ww float number of white-white joins
bw float number of black-white joins
J float number of joins
Ebb float expected value of bb under free sampling
Eww float expected value of ww under free sampling
Ebw float expected value of bw under free sampling
Vbb float variance of bb under free sampling
Vww float variance of ww under free sampling
Vbw float variance of bw under free sampling
zbb float z-value for bb under free sampling
zww float z-value for ww under free sampling
zbw float z-value for bw under free sampling