Testing spatial segregation using a nearest-neighbor contingency table