| Title: | Characterizing Observed and Expected Representation |
|---|---|
| Description: | A system for analyzing descriptive representation, especially for comparing the composition of a political body to the population it represents. Users can compute the expected degree of representation for a body under a random sampling model, the expected degree of representation variability, as well as representation scores from observed political bodies. The package also provides district-level benchmarks for expected representation in single-member district systems, where district compositions follow a Dirichlet distribution and seats are filled by random sampling or largest-group-wins affinity voting, as well as group-level representation diagnostics and comparisons between bodies. The package is based on Gerring, Jerzak, and Oncel (2024) <doi:10.1017/S0003055423000680>. |
| Authors: | Connor Jerzak [aut, cre] (ORCID: <https://orcid.org/0000-0003-1914-8905>), John Gerring [aut] (ORCID: <https://orcid.org/0000-0001-9858-2050>), Erzen Oncel [aut] (ORCID: <https://orcid.org/0000-0001-9372-1090>) |
| Maintainer: | Connor Jerzak <[email protected]> |
| License: | GPL-3 |
| Version: | 1.2.0 |
| Built: | 2026-10-08 08:04:44 UTC |
| Source: | https://github.com/cjerzak/descriptiverepresentationcalculator-software |
Calculates the difference in observed representation between two political bodies (or two tiers of the same legislature) measured against the same population shares. This is the tier-comparison statistic used in Gerring, Hicken, Jerzak, Moser, and Oncel (book manuscript) to compare multi-member and single-member district tiers of mixed electoral systems.
CompareRepresentation(BodyMemberCharacteristics1, BodyMemberCharacteristics2, PopShares, BodyShares1, BodyShares2, a = -0.5, b = 1, metric = c("L1", "L2"))CompareRepresentation(BodyMemberCharacteristics1, BodyMemberCharacteristics2, PopShares, BodyShares1, BodyShares2, a = -0.5, b = 1, metric = c("L1", "L2"))
BodyMemberCharacteristics1, BodyMemberCharacteristics2
|
Vectors specifying the characteristics for members of the first and second political body. |
PopShares |
A numeric vector specifying population shares of identities specified in the body-member characteristics inputs. The names of the entries in |
BodyShares1, BodyShares2
|
(optional) Numeric vectors with same structure as |
a, b
|
Parameters controlling the affine transformation for how the representation measure is summarized, passed to |
metric |
A character string selecting the deviation metric underlying the representation index
( |
A scalar giving the observed representation of the first body minus that of the second body. Positive values indicate that the first body more closely mirrors the population; negative values indicate that the second body does.
John Gerring, Connor T. Jerzak, Erzen Oncel. (2024), The Composition of Descriptive Representation, American Political Science Review, 118(2): 784-801. doi:10.1017/S0003055423000680
John Gerring, Allen Hicken, Connor T. Jerzak, Robert G. Moser, Erzen Oncel. Electoral Rules and Descriptive Representation: A Comprehensive View Across Multiple Identities. Book manuscript.
ObservedRepresentation for the per-body representation index.
RelativeRepresentation for comparing one body to its random-sampling expectation.
# Compare an MMD tier to an SMD tier of the same legislature CompRep <- CompareRepresentation( BodyMemberCharacteristics1 = c("A","B","A","B","A","A"), BodyMemberCharacteristics2 = c("A","A","A","A","A","B"), PopShares = c("A" = 0.55, "B" = 0.45)) print( CompRep )# Compare an MMD tier to an SMD tier of the same legislature CompRep <- CompareRepresentation( BodyMemberCharacteristics1 = c("A","B","A","B","A","A"), BodyMemberCharacteristics2 = c("A","A","A","A","A","B"), PopShares = c("A" = 0.55, "B" = 0.45)) print( CompRep )
Finds the expected degree of representation for a political body elected from single-member districts, where district-level group compositions are drawn from a Dirichlet distribution, as derived in Gerring, Hicken, Jerzak, Moser, and Oncel (book manuscript on electoral rules and descriptive representation).
ExpectedDistrictRepresentation(PopShares, concentration, nDistricts, selectionRule = c("random", "affinity"), a = -0.5, b = 1, nMonte = 10000)ExpectedDistrictRepresentation(PopShares, concentration, nDistricts, selectionRule = c("random", "affinity"), a = -0.5, b = 1, nMonte = 10000)
PopShares |
A numeric vector containing the group-level population proportions
(the mean district shares). Under |
concentration |
A positive number giving the Dirichlet concentration parameter
( |
nDistricts |
A positive integer denoting the number of single-member districts,
or |
selectionRule |
A character string specifying how each district seat is filled.
|
a, b
|
Parameters controlling the affine transformation for how the representation
measure is summarized. The expected sum of squared deviations between aggregate population
shares and seat shares is multiplied by |
nMonte |
A positive integer denoting the number of Monte Carlo draws used to
approximate the plurality-win probabilities when |
This function computes the expected value of the squared-deviation representation index
(the metric = "L2" index; see ObservedRepresentation), not the L1-based
Rose Index of Proportionality. The squared-deviation index upper-bounds the Rose Index
and preserves the ordering of representation gaps when there are two groups.
Under selectionRule = "random", the expectation has the closed form
1 - (1/(2*nDistricts)) * sum(alpha*(alpha0-alpha)/(alpha0*(alpha0+1))) (with default
a, b), where alpha = concentration * PopShares and alpha0 = concentration.
As nDistricts grows, the expectation approaches 1: with many districts,
random-sampling representation converges to the proportional benchmark. Setting
nDistricts = Inf returns this limit.
Under selectionRule = "affinity", the expectation depends on each group's plurality-win
probability (the probability it is the largest group in a district) and, for finite
nDistricts, on the upper-tail moment of the district-share distribution. With two groups,
both quantities have closed forms in terms of the Beta distribution function and results
are exact. With more than two groups, they are approximated by Monte Carlo simulation of
Dirichlet draws (set a seed for reproducibility). Setting nDistricts = Inf returns the
large-district limit, 1 - (1/2) * sum((PopShares - PluralityProbs)^2) (with default
a, b), which equals 1 only when each group's probability of being the district
plurality matches its population share. The gap between these two quantities captures
the representational consequences of geographic concentration under affinity voting.
The expected degree of representation (a scalar).
John Gerring, Connor T. Jerzak, Erzen Oncel. (2024), The Composition of Descriptive Representation, American Political Science Review, 118(2): 784-801. doi:10.1017/S0003055423000680
John Gerring, Allen Hicken, Connor T. Jerzak, Robert G. Moser, Erzen Oncel. Electoral Rules and Descriptive Representation: A Comprehensive View Across Multiple Identities. Book manuscript.
ExpectedRepresentation for expected representation of a single body under random sampling.
ObservedRepresentation for calculating representation scores from observed data.
# Expected representation under random sampling with 100 districts ExpectedDistrictRep <- ExpectedDistrictRepresentation( PopShares = c(1/4, 2/4, 1/4), concentration = 2, nDistricts = 100) print( ExpectedDistrictRep ) # Large-district limit under largest-group-wins affinity voting (two groups; # computed exactly via the Beta distribution function) ExpectedAffinityRep <- ExpectedDistrictRepresentation( PopShares = c(0.3, 0.7), concentration = 4, nDistricts = Inf, selectionRule = "affinity") print( ExpectedAffinityRep )# Expected representation under random sampling with 100 districts ExpectedDistrictRep <- ExpectedDistrictRepresentation( PopShares = c(1/4, 2/4, 1/4), concentration = 2, nDistricts = 100) print( ExpectedDistrictRep ) # Large-district limit under largest-group-wins affinity voting (two groups; # computed exactly via the Beta distribution function) ExpectedAffinityRep <- ExpectedDistrictRepresentation( PopShares = c(0.3, 0.7), concentration = 4, nDistricts = Inf, selectionRule = "affinity") print( ExpectedAffinityRep )
Finds the degree of expected representation for any group in a political body under a random sampling model as described in Gerring, Jerzak and Oncel (2024).
ExpectedRepresentation(PopShares, BodyN, a = -0.5, b = 1, metric = c("L1", "L2"))ExpectedRepresentation(PopShares, BodyN, a = -0.5, b = 1, metric = c("L1", "L2"))
PopShares |
A numeric vector containing the group-level population proportions. |
BodyN |
A positive integer denoting the size of the political body in question. |
a, b
|
The |
metric |
A character string selecting the deviation metric underlying the representation index.
|
The expected degree of representation (a scalar).
John Gerring, Connor T. Jerzak, Erzen Oncel. (2024), The Composition of Descriptive Representation, American Political Science Review, 118(2): 784-801. doi:10.1017/S0003055423000680
ObservedRepresentation for calculating representation scores from observed data.
SDRepresentation for calculating representation unexplained under the random sampling model.
ExpectedDistrictRepresentation for expected representation in district-based electoral systems.
ExpectedRep <- ExpectedRepresentation(PopShares = c(1/4, 2/4, 1/4), BodyN = 50) print( ExpectedRep )ExpectedRep <- ExpectedRepresentation(PopShares = c(1/4, 2/4, 1/4), BodyN = 50) print( ExpectedRep )
Computes, for each group, the gap between its population share and its share of a political body, both as a raw difference ("shortfall") and as a fraction of the group's population share. These are the group-level "Shortfall" and "Share" measures used in Gerring, Hicken, Jerzak, Moser, and Oncel (book manuscript). The raw shortfall accentuates the under-representation of large groups; the ratio accentuates the under-representation of small groups.
GroupRepresentation(BodyMemberCharacteristics, PopShares, BodyShares)GroupRepresentation(BodyMemberCharacteristics, PopShares, BodyShares)
BodyMemberCharacteristics |
A vector specifying the characteristics for members of a political body. |
PopShares |
A numeric vector specifying population shares of identities specified in the body-member characteristics input. The names of the entries in |
BodyShares |
(optional) A numeric vector with same structure as |
A data.frame with one row per group and columns:
Group: the group label (names of PopShares, or the group index if unnamed).
PopShare: the group's population share.
BodyShare: the group's share of the body.
Shortfall: PopShare - BodyShare. Positive values indicate under-representation;
negative values indicate over-representation.
ShortfallRatio: Shortfall / PopShare, the shortfall as a fraction of the group's
population share (Inf or NaN when PopShare is zero). A value of 1 means the group is
entirely absent from the body; 0 means proportional representation; negative values indicate
over-representation.
Returns NA if the body is empty or shares cannot be resolved.
John Gerring, Connor T. Jerzak, Erzen Oncel. (2024), The Composition of Descriptive Representation, American Political Science Review, 118(2): 784-801. doi:10.1017/S0003055423000680
John Gerring, Allen Hicken, Connor T. Jerzak, Robert G. Moser, Erzen Oncel. Electoral Rules and Descriptive Representation: A Comprehensive View Across Multiple Identities. Book manuscript.
ObservedRepresentation for summarizing these gaps into a single representation index.
CompareRepresentation for comparing the representation indices of two bodies.
GroupRep <- GroupRepresentation( BodyMemberCharacteristics = c("A","A","C","A","C","A"), PopShares = c("A"=1/4, "B"=2/4, "C"=1/4)) print( GroupRep )GroupRep <- GroupRepresentation( BodyMemberCharacteristics = c("A","A","C","A","C","A"), PopShares = c("A"=1/4, "B"=2/4, "C"=1/4)) print( GroupRep )
Finds the degree of observed representation for any group in a political body.
ObservedRepresentation(BodyMemberCharacteristics, PopShares, BodyShares, a = -0.5, b = 1, metric = c("L1", "L2"))ObservedRepresentation(BodyMemberCharacteristics, PopShares, BodyShares, a = -0.5, b = 1, metric = c("L1", "L2"))
BodyMemberCharacteristics |
A vector specifying the characteristics for members of a political body. |
PopShares |
A numeric vector specifying population shares of identities specified in the body-member characteristics input. The names of the entries in |
BodyShares |
(optional) A numeric vector with same structure as |
a, b
|
Parameters controlling the affine transformation for how the representation measure is summarized.
That is, |
metric |
A character string selecting the deviation metric underlying the representation index.
|
The observed degree of representation (a scalar). By default, this quantity is the Rose Index of Proportionality.
ExpectedRepresentation for calculating expected representation scores under random sampling.
SDRepresentation for calculating representation unexplained under the random sampling model.
ObsRep <- ObservedRepresentation( BodyMemberCharacteristics = c("A","A","C","A","C","A"), PopShares = c("A"=1/4,"B"=2/4, "C"=1/4)) print( ObsRep )ObsRep <- ObservedRepresentation( BodyMemberCharacteristics = c("A","A","C","A","C","A"), PopShares = c("A"=1/4,"B"=2/4, "C"=1/4)) print( ObsRep )
Calculates the difference between observed and expected representation. Optionally standardizes this difference using the standard deviation of representation under the random sampling model.
RelativeRepresentation(BodyMemberCharacteristics, PopShares, a = -0.5, b = 1, standardize = FALSE, nMonte = 10000, metric = c("L1", "L2"))RelativeRepresentation(BodyMemberCharacteristics, PopShares, a = -0.5, b = 1, standardize = FALSE, nMonte = 10000, metric = c("L1", "L2"))
BodyMemberCharacteristics |
A vector specifying characteristics for each member of a political body. |
PopShares |
A numeric vector of population group proportions. Names must
correspond to identities in |
a, b
|
Parameters controlling the affine transformation of the
representation index, passed to |
standardize |
Logical. If |
nMonte |
A positive integer denoting number of Monte Carlo iterations used
for estimating the standard deviation when |
metric |
A character string selecting the deviation metric underlying the
representation index ( |
A scalar giving the difference between observed and expected
representation. If standardize = TRUE, the difference is divided by the
standard deviation under the random sampling model.
ObservedRepresentation,
ExpectedRepresentation,
SDRepresentation
Finds the residual standard deviation when using the expected representation for any group in a political body to predict observed representation as described in Gerring, Jerzak and Oncel (2024).
SDRepresentation(PopShares, BodyN, a = -0.5, b = 1, nMonte = 10000, metric = c("L1", "L2"))SDRepresentation(PopShares, BodyN, a = -0.5, b = 1, nMonte = 10000, metric = c("L1", "L2"))
PopShares |
A numeric vector containing the group-level population proportions. |
BodyN |
A positive integer denoting the size of the political body in question. |
a, b
|
Parameters controlling the affine transformation for how the representation measure is summarized.
That is, |
nMonte |
A positive integer denoting number of Monte Carlo iterations used to approximate the variance of representation under a random sampling model. |
metric |
A character string selecting the deviation metric underlying the representation index.
|
A scalar summary of the amount of representation not explained by a random sampling model. More precisely, this function returns the the residual standard deviation when using the expected degree of representation to predict observed representation under a random sampling model.
John Gerring, Connor T. Jerzak, Erzen Oncel. (2024), The Composition of Descriptive Representation, American Political Science Review, 118(2): 784-801. doi:10.1017/S0003055423000680
ExpectedRepresentation for calculating expected representation scores under random sampling.
ObservedRepresentation for calculating representation scores from observed data.
SDRep <- SDRepresentation(PopShares = c(1/4, 2/4, 1/4), BodyN = 50) print( SDRep )SDRep <- SDRepresentation(PopShares = c(1/4, 2/4, 1/4), BodyN = 50) print( SDRep )