segregation.local.MultiLocalSimpsonInteraction

class segregation.local.MultiLocalSimpsonInteraction(data, groups)[source]

Calculation of Local Simpson Interaction index for each unit

Parameters
dataa pandas DataFrame of n rows
groupslist of strings.

The variables names in data of the groups of interest of the analysis.

Notes

Based on the local version of Equation 1 of page 37 of Reardon, Sean F., and Glenn Firebaugh. “Measures of multigroup segregation.” Sociological methodology 32.1 (2002): 33-67.

Simpson’s interaction index can be simply interpreted as the probability that two individuals chosen at random and independently from the population will be found to not belong to the same group.

Higher values means lesser segregation.

Simpson’s Concentration + Simpson’s Interaction = 1

Reference: [RF02].

Examples

In this example, we are going to use 2000 Census Tract Data for Sacramento MSA, CA. The groups of interest are White, Black, Asian and Hispanic population.

Firstly, we need to perform some import the modules and the respective function.

>>> import libpysal
>>> import geopandas as gpd
>>> from segregation.local import MultiLocalSimpsonInteraction

Then, we read the data and create an auxiliary list with only the necessary columns for fitting the index.

>>> input_df = gpd.read_file(libpysal.examples.get_path("sacramentot2.shp"))
>>> groups_list = ['WHITE_', 'BLACK_', 'ASIAN_','HISP_']

The value is estimated below.

>>> index = MultiLocalSimpsonInteraction(input_df, groups_list)
>>> index.statistics[0:10] # Values of first 10 units
array([0.15435993, 0.33391595, 0.49909747, 0.1299449 , 0.09805056,
       0.13128178, 0.04447356, 0.0398933 , 0.03723054, 0.11758548])
Attributes
statisticsnp.array(n)

Local Simpson Interaction values for each unit

core_dataa pandas DataFrame

A pandas DataFrame that contains the columns used to perform the estimate.

__init__(data, groups)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(data, groups)

Initialize self.