library(PRcalc)
data(nz_district)
<- nz_district |>
nz_1949 subset(year == 1949) |>
as_prcalc(l1 = "region",
l2 = "district",
p = "electorates",
q = "magnitude",
type = "nested")
decompose3(nz_1949, special = "Maori")
alpha = 2
alpha-divergence Special Reapportionment Redistricting
6.037171e-02 6.536250e-03 3.606409e-06 5.383185e-02
Note: "alha-divergence" is sum of "Special", "Reapportionment" and "Redisticting" terms.