Calculate Partisan Dislocation
part_dislocation(
plans,
shp,
dvote,
rvote,
total_pop = dvote + rvote,
epsg = 3857,
by_precinct = FALSE,
signed = TRUE
)
A redist_plans
object or plans_matrix where each row indicates a district assignment and each column is a plan.
A redist_map
object, tibble, or data frame with an sf
geometry column.
Unqouted name of column in shp
with total population.
Unqouted name of column in shp
with group population.
Unqouted name of column in shp
with total population.
Numeric EPSG code to use to project the shapefile, if needed. Default is 3857.
Defaults to FALSE
, returning district-level values.
Defaults to TRUE
. Should the output for district-level values be signed?
Setting to TRUE
returns precinct-level values.
A numeric vector. Can be shaped into a district-by-plan matrix.
DeFord, D. R., Eubank, N., & Rodden, J. (2022). Partisan dislocation: A precinct-level measure of representation and gerrymandering. Political Analysis, 30(3), 403-425.
data(nh)
data(nh_m)
# For a single plan:
part_dislocation(plans = nh$r_2020, shp = nh, rvote = nrv, dvote = ndv)
#> [1] -0.03315532 0.05566666
# Or many plans:
part_dislocation(plans = nh_m[, 3:5], shp = nh, rvote = nrv, dvote = ndv)
#> [1] 0.026426642 -0.005861866 0.039019354 -0.018983433 0.044388704
#> [6] -0.024102163