cosfun: Calculates the cosine measure

Description Usage Arguments Details Value Author(s) References See Also

View source: R/cosfun.R

Description

Calculates the cosine measure based on a population vector and a vector for the representatives

Usage

1
cosfun(Z,R)

Arguments

Z

Population vector

R

Vector for the representatives

Details

Calculates the cosine of a vector of voters and a vector for the representatives. These are the cosine proportionality scores presented by Koppel and Diskin (2009). Given are the '1-cos' values, which are not proper metrics (they do not have the triangle inequality property).

The order of the groups in the population vector and the vector for the representatives needs to be the same. If there are groups A, B, C in the population, both vectors need to cover their proportion in the same order.

cosunf = 1-(∑(Z * R)/(∑(Z^2) * ∑(R^2))^{\frac{1}{2}})

Other routines are implemented in the packages 'tcR', 'SciencesPo' (no longer on CRAN, see https://github.com/danielmarcelino/SciencesPo and the 'Proportionality' measure therein), and 'lsa'.

Value

A single score given the population and representatives

Author(s)

Didier Ruedin

References

Koppel, M., and A. Diskin. (2009) Measuring disproportionality, volatility and malapportionment: axiomatization and solutions. Social Choice and Welfare 33, no. 2: 281-286.

See Also

Farina, cosine.similarity, cosine.similarity, cosine


polrep documentation built on Feb. 24, 2018, 3:01 a.m.