RelativeRepresentation: Compute relative representation compared to random sampling

View source: R/RelativeRep.R

RelativeRepresentationR Documentation

Compute relative representation compared to random sampling

Description

Calculates the difference between observed and expected representation. Optionally standardizes this difference using the standard deviation of representation under the random sampling model.

Usage

RelativeRepresentation(BodyMemberCharacteristics,
                       PopShares,
                       a = -0.5, b = 1,
                       standardize = FALSE,
                       nMonte = 10000)

Arguments

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 BodyMemberCharacteristics.

a, b

Parameters controlling the affine transformation of the representation index, passed to ObservedRepresentation and ExpectedRepresentation.

standardize

Logical. If TRUE, the difference between observed and expected representation is divided by the standard deviation of representation under random sampling.

nMonte

A positive integer denoting number of Monte Carlo iterations used for estimating the standard deviation when standardize = TRUE.

Value

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.

See Also

ObservedRepresentation, ExpectedRepresentation, SDRepresentation


DescriptiveRepresentationCalculator documentation built on Dec. 15, 2025, 1:06 a.m.