This implements Crespin's 2005 measure of district continuity, as applied to the geographies represented by a plan, typically precincts or voting districts. This implementation assumes none of the precincts in plan_old or plan_new are split.

redist.dist.pop.overlap(plan_old, plan_new, total_pop, normalize_rows = TRUE)

Arguments

plan_old

The reference or original plan to compare against

plan_new

The new plan to compare to the reference plan

total_pop

The total population by precinct This can also take a redist_map object and will use the population in that object. If nothing is provided, it weights all entries in plan equally.

normalize_rows

Default TRUE. Normalize populations by row. If FALSE, normalizes by column. If NULL, does not normalize.

Value

matrix with length(unique(plan_old)) rows and length(unique(plan_new)) columns

References

"Using Geographic Information Systems to Measure District Change, 2000-02", Michael Crespin, Political Analysis (2005) 13(3): 253-260

Examples

set.seed(5)
data(iowa)
iowa_map <- redist_map(iowa, total_pop = pop, pop_tol = 0.01, ndists = 4)
plans <- redist_smc(iowa_map, 2)
#> SEQUENTIAL MONTE CARLO
#> Sampling 2 99-unit maps with 4 districts and population between 753,973 and 769,205.
#> 
Split [0/3]  | ETA?

#> 
Split [3/3] ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  | ETA 0s

#> 
plans_mat <- get_plans_matrix(plans)
ov <- redist.dist.pop.overlap(plans_mat[, 1], plans_mat[, 2], iowa_map)
round(ov, 2)
#>   1 2    3    4
#> 1 1 0 0.00 0.00
#> 2 0 1 0.00 0.00
#> 3 0 0 0.99 0.01
#> 4 0 0 0.01 0.99

ov_col <- redist.dist.pop.overlap(plans_mat[, 1], plans_mat[, 2], iowa_map, normalize_rows = FALSE)
round(ov_col, 2)
#>   1 2    3    4
#> 1 1 0 0.00 0.00
#> 2 0 1 0.00 0.00
#> 3 0 0 0.99 0.01
#> 4 0 0 0.01 0.99

ov_un_norm <- redist.dist.pop.overlap(plans_mat[, 1], plans_mat[, 2],
    iowa_map, normalize_rows = NULL)
round(ov_un_norm, 2)
#>        1      2      3      4
#> 1 758834      0      0      0
#> 2      0 762204      0      0
#> 3      0      0 755546   5131
#> 4      0      0   4029 760611

iowa_map_5 <- iowa_map <- redist_map(iowa, total_pop = pop, pop_tol = 0.01, ndists = 5)
plan_5 <- get_plans_matrix(redist_smc(iowa_map_5, 1))
#> SEQUENTIAL MONTE CARLO
#> Sampling 1 99-unit maps with 5 districts and population between 603,178 and 615,364.
#> 
Split [0/4]  | ETA?

#> 
Split [4/4] ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■  | ETA 0s

#> 
ov4_5 <- redist.dist.pop.overlap(plans_mat[, 1], plan_5, iowa_map)
round(ov4_5, 2)
#>      1    2    3    4    5
#> 1 0.47 0.50 0.04 0.00 0.00
#> 2 0.00 0.31 0.62 0.00 0.07
#> 3 0.24 0.00 0.00 0.15 0.61
#> 4 0.09 0.00 0.15 0.65 0.12