Decomposition using a prcalc object.

Description

Decomposition using a prcalc object.

Usage

decompose(x, alpha = 2, special = NULL, ...)

## S3 method for class 'prcalc'
decompose(x, alpha = 2, special = NULL, ...)

Arguments

x a prcalc object.
alpha Default is 2. If the goal is to calculate disproportionality, alpha should be greater than 0.
special a character. names of special district. If it is defined, three-step decomposition is conducted.
ignored

Value

a prcalc_decomposition object.

References

  • Yuta, Kamahara. "The Desired Political Entropy as the Measure of Unequal Representation: Disproportionality and Malapportionment". Working paper.

See Also

decompose2, decompose3

Examples

library(PRcalc)

# two-step decomposition (example 1)
data("jp_lower_2021")

obj <- prcalc(jp_lower_2021,
              m = c(8, 14, 20, 21, 17, 11, 21, 30, 11, 6, 21),
              method = "hare")

decompose(obj)
alpha = 2 
alpha-divergence  Reapportionment    Redistricting 
      0.03952282       0.00324211       0.03628070 

Note: "alha-divergence" is sum of "Reapportionment" and "Redisticting" terms.
# two-step decomposition (example 2)
data("au_district_2010")

au_data <- au_district_2010 |>
  as_prcalc(l1   = "region",
            l2   = "district",
            p    = "electorates",
            q    = "magnitude",
            type = "nested")

decompose(au_data, alpha = 0)
alpha = 0 
alpha-divergence  Reapportionment    Redistricting 
     0.004280586      0.003107794      0.001172792 

Note: "alha-divergence" is sum of "Reapportionment" and "Redisticting" terms.
# three-step decomposition
data("nz_district")

nz_district |>
  dplyr::filter(year == 2011) |>
  as_prcalc(l1   = "region",
            l2   = "district",
            p    = "electorates",
            q    = "magnitude",
            type = "nested") |>
  decompose(alpha = 0, special = "Maori")
alpha = 0 
alpha-divergence          Special  Reapportionment    Redistricting 
    1.749517e-03     1.247976e-03     2.041288e-06     4.995002e-04 

Note: "alha-divergence" is sum of "Special", "Reapportionment" and "Redisticting" terms.