get.ipc: Computes the Intra-party Competition Index

Description Usage Arguments Details Value Author(s) References Examples

Description

Intra-party competition is given by:

ipc = \frac{(2 * N)}{(Magnitude - 1)}

Usage

1
get.ipc(n, mag = NULL)

Arguments

n

is a numeric value or a vector containing the number of candidates for a given party nested within districts.

mag

is the district magnitude quantity or a vector containing a list of district magnitudes.

Details

Normatively, it is necessary two times the number of candidates out the district magnitude size to generate electoral competitiveness. When it comes to the party level in PR systems, the basic “objective” measure is to apply the same reasoning to identify competitiveness not between parties but also within party. Then, the higher the IPC found, the higher the intra-party competition for a given party.

Value

Either a numeric value or a vector with the IPC for each observation.

Author(s)

Daniel Marcelino

References

http://danielmarcelino.com/SciencePo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# First example: generate some raw data

data <- data.frame( 
	i=i <- rep(1, len = 100),
	t=t<-sample(c("2008", "2012"), 100, replace=TRUE),
	p=p <- sample(LETTERS[1:3], 100, replace=TRUE),
	j=j <- sample(letters[1:13], 100, replace=TRUE) )

## The intraparty competition index for each party nested within districts over time.

data$tcan = with(data, ave(i, t, p, j, FUN = sum))

get.ipc(data$tcan, mag = 2)

# Second example: generate some aggregate data

data2 <- data.frame( 
	a_i=i <- rep(1:5, c(1, 1, 4, 4, 3)),
	t=t<-sample(c("2008", "2012"), 13, replace=TRUE),
	p=p <- sample(LETTERS[1:3], 13, replace=TRUE),
	j=j <- sample(letters[1:13], 13, replace=FALSE) )

## The intraparty competition index for each party nested within districts over time.

get.ipc(data2$a_i, mag = 1)

SciencePo documentation built on May 2, 2019, 5:53 p.m.