segregation.inference.TwoValueTest

class segregation.inference.TwoValueTest(seg_class_1, seg_class_2, iterations_under_null=500, null_approach='random_label', **kwargs)[source]

Perform inference comparison for a two segregation measures

Parameters
seg_class_1a PySAL segregation object to be compared to seg_class_2
seg_class_2a PySAL segregation object to be compared to seg_class_1
iterations_under_nullnumber of iterations under null hyphothesis
null_approachargument that specifies which type of null hypothesis the inference will iterate.

“random_label” : random label the data in each iteration

“counterfactual_composition” : randomizes the number of minority population according to both cumulative distribution function of a variable that represents the composition of the minority group. The composition is the division of the minority population of unit i divided by total population of tract i.

“counterfactual_share” : randomizes the number of minority population and total population according to both cumulative distribution function of a variable that represents the share of the minority group. The share is the division of the minority population of unit i divided by total population of minority population.

“counterfactual_dual_composition” : applies the “counterfactual_composition” for both minority and complementary groups.

**kwargscustomizable parameters to pass to the segregation measures. Usually they need to be the same as both seg_class_1 and seg_class_2 was built.

Notes

This function performs inference to compare two segregation measures. This can be either two measures of the same locations in two different points in time or it can be two different locations at the same point in time.

The null hypothesis is H0: Segregation_1 is not different than Segregation_2.

Based on Rey, Sergio J., and Myrna L. Sastré-Gutiérrez. “Interregional inequality dynamics in Mexico.” Spatial Economic Analysis 5.3 (2010): 277-298.

Examples

Several examples can be found here https://github.com/pysal/segregation/blob/master/notebooks/inference_wrappers_example.ipynb.

Attributes
p_valuefloat

Two-Tailed p-value

est_simnumpy array

Estimates of the segregation measure differences under the null hypothesis

est_point_difffloat

Point estimation of the difference between the segregation measures

Methods

plot([ax])

Plot the Compare_Segregation class

__init__(seg_class_1, seg_class_2, iterations_under_null=500, null_approach='random_label', **kwargs)[source]

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

Methods

__init__(seg_class_1, seg_class_2[, …])

Initialize self.

plot([ax])

Plot the Compare_Segregation class