rankComp | R Documentation |
Perform a ranking comparison between two indices.
rankComp(ref, alt, highest.first = TRUE, id = NULL, time = NULL)
ref |
a numeric vector of reference index values. |
alt |
a numeric vector of alternative index values. |
highest.first |
a logical value indicating whether the highest value
gets ranking #1. If |
id |
a vector of unit identifiers. |
time |
a vector of temporal factors. |
An object of classes "rankComp"
and "data.frame"
containing the following
columns:
id |
the unit identifiers (if provided). |
time |
the temporal factors (if provided). |
ref.rank |
the ranking based on the reference index. |
alt.rank |
the ranking based on the alternative index. |
shift |
the ranking shifts between two indices. |
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
summary.rankComp
, rankScatterPlot
, rankShiftPlot
,
rankRankPlot
.
data(bli)
# Goalpost normalization
bli.pol = c("neg", "pos", "pos", "pos", "pos", "neg",
"pos", "pos", "pos", "neg", "pos")
bli.norm.2014 <- normalize(inds = bli[, 3:13], method = "goalpost",
ind.pol = bli.pol, time = bli$YEAR,
ref.time = 2014)
# Composite indices
ci.gini <- giniCI(bli.norm.2014, method = "gini",
ci.pol = "pos", time = bli$YEAR, ref.time = 2014,
only.ci = TRUE)
ci.reci <- giniCI(bli.norm.2014, method = "reci", agg = "geo",
ci.pol = "pos", time = bli$YEAR, ref.time = 2014,
only.ci = TRUE)
# Ranking comparison
ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR)
print(ci.comp)
summary(ci.comp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.