Learn R Programming

polAr (version 0.2.0.1)

compute_nep: Calcula Numero Efectivo de Partidos Politicos - NEP (Computes Effective Number of Political Parties)

Description

Funci<U+00F3>n que calcula el NEP: indicador que provee un n<U+00FA>mero "ajustado" de partidos pol<U+00ED>ticos en un sistema de part<U+00ED>dos (Function that computes NEP: indicator that provides a "tight" number of political parties in a party system)

Usage

compute_nep(data, index = "All")

Arguments

data

la base de datos para hacer el c<U+00E1>lculo obtenida con get_election_data (tiblle downloaded with get_election_data needed to compute nep).

index

un character con la f<U+00F3>rmula elegida: "Laakso-Taagepera", "Golosov" o ambas -opci<U+00F3>n por defecto- (a character with the chosen formula: 'Laakso-Taagepera', 'Golosov' or both -dafault value).

Value

Devuelve un tibble con class "tbl_df","tbl", "data.frame" de dimensiones variables segu<U+00FA>n el nivel de agrupamiento de data con el c<U+00F3>mputo del n<U+00FA>mero ajustado de fuerzas en un sistema de partidos (Returns a tibble with class "tbl_df", "tbl", "data.frame", of variable dimensions according to the grouping level of data with a "tight" numero of political parties in a party system as outcome).

Como minimo tres variables (At least three variables:):

*codprov que es el agrupamiento de m<U+00E1>s alto nivel (provincial). Se pueden sumar otros niveles: coddepto para nivel departamental y circuito para el nivel que le sigue (codprov which is the highest level grouping -provincial. Other levels can be added: coddepto for departmental level and circuito for the level that follows).

* value: el valor calculado del NEP (NEP computation)

* index: el m<U+00E9>todo utilizado para calcular el NEP (NEP methodology used for computation)

Details

El computo solo se hace a partir de la cantidad de votos de cada lista y no de las bancas (The computation is only made from the number of votes for each ballot and not from the corresponding legislativa seats).

Impementaci<U+00F3>n de las f<U+00F3>rmulas "Laakso-Taagepera" y "Golosov" donde \(p_{1}\) es el porcentaje de votos de una lista \(i\) y \(p_{max}\) es el porcentaje de votos que sac<U+00F3> la lista m<U+00E1>s votada (Implementation of the "Laakso-Taagepera" and "Golosov" formulas, where \(p_{1}\) is vote percentage for a list \(i\) and \(p_{max}\) the percentage for the most voted party).

\(\large Laakso-Tagepera\): $$NEP_{Laakso-Tagepera}=\frac{1}{\sum_{i}^{n}p_{i}^2}$$

\(\large Golosov\): $$NEP_{Golosov}=\frac{p_{i}}{\sum_{i}^{n} p_{i}+p_{max}^2-p_{i}^2}$$

REQUISITO:

El formato de data debe ser long para calcular compute_nep. Si data es wide se puede transformar con make_long (long format of data is required for compute_nep. If data is in wide format you can transform it with make_long)

NOTA:

el par<U+00E1>metro level de get_election_data determina el nivel de agregacion sobre el que se computa el NEP: provincia, departamento o circuito (level at get_election_data determines aggregation on which NEP calculation will be made: provincia, departamento or circuito).

See Also

compute_competitiveness, compute_seats, compute_disproportion

Examples

Run this code
# NOT RUN {
tucuman_dip_gral_2017

tucuman_dip_gral_2017 %>% 
  compute_nep()

# }

Run the code above in your browser using DataLab