Learn R Programming

giniCI (version 0.1.0)

rankComp: Ranking Comparison

Description

Perform a ranking comparison between two indices.

Usage

rankComp(ref, alt, highest.first = TRUE, id = NULL, time = NULL)

Value

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.

Arguments

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 FALSE, the lowest value gets ranking #1.

id

a vector of unit identifiers.

time

a vector of temporal factors.

Author

Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi

See Also

summary.rankComp, rankScatterPlot, rankShiftPlot, rankRankPlot.

Examples

Run this code
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)

Run the code above in your browser using DataLab