Description Usage Arguments Details Value Author(s) References Examples
Intra-party competition is given by:
ipc = \frac{(2 * N)}{(Magnitude - 1)}
1 |
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. |
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.
Either a numeric value or a vector with the IPC for each observation.
Daniel Marcelino
http://danielmarcelino.com/SciencePo
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.