| Title: | Gini-Based Composite Indicators |
|---|---|
| Description: | An implementation of Gini-based weighting approaches in constructing composite indicators, providing functionalities for normalization, aggregation, and ranking comparison. |
| Authors: | Viet Duong Nguyen [aut, cre] (ORCID: <https://orcid.org/0009-0001-0227-3112>), Chiara Gigliarano [aut] (ORCID: <https://orcid.org/0000-0003-2861-1316>), Mariateresa Ciommi [aut] (ORCID: <https://orcid.org/0000-0003-4131-4543>) |
| Maintainer: | Viet Duong Nguyen <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.3 |
| Built: | 2026-06-03 09:12:28 UTC |
| Source: | https://github.com/novidu/ginici |
This dataset includes 11 well-being indicators for 36 countries spanning the years 2014 to 2017. The indicators are derived from the OECD Better Life Index, which measures 11 topics deemed essential by the OECD for assessing material living conditions and quality of life.
blibli
A data frame with 144 rows and 13 variables:
Country.
Year.
Housing expenditure: percentage of housing costs in households gross adjusted disposable income.
Household income: average amount of money that a household earns per year, after taxes.
Employment rate: percentage of people, aged 15 to 64, currently in a paid job.
Quality of support network: percentage of people who believe they can rely on their friends in case of need.
Educational attainment: percentage of people, aged 25 to 64, having at least an upper-secondary (high school) degree.
Air pollution: average concentration of particulate matter (PM2.5) in the air.
Voter turnout: percentage of registered voters who voted during recent elections.
Life expectancy: average number of years a person can expect to live.
Life satisfaction: average self-evaluation of life satisfaction, on a scale from 0 to 10.
Homicide rate: average number of reported homicides per 100,000 people.
Leisure and personal care: average number of hours per day spent on leisure and personal care, including sleeping and eating.
OECD (2024). Better Life Index (Editions 2014, 2015, 2016, and 2017), OECD Social and Welfare Statistics (database). Accessed on December 06, 2024.
Compute a composite index with weighting schemes based on the Gini coefficient of constituent indicators, with options for aggregation methods and horizontal variability adjustment.
giniCI(inds, method = c("equal", "gini", "reci"), agg = c("ari", "geo"), hv = TRUE, ci.pol = c("pos", "neg"), time = NULL, ref.time = NULL, only.ci = FALSE)giniCI(inds, method = c("equal", "gini", "reci"), agg = c("ari", "geo"), hv = TRUE, ci.pol = c("pos", "neg"), time = NULL, ref.time = NULL, only.ci = FALSE)
inds |
a matrix or data frame of indicators to be aggregated. |
method |
weighting method to be used. See |
agg |
aggregation function to be used, with |
hv |
a logical value indicating whether horizontal variability adjustment should be applied. |
ci.pol |
a character value indicating the polarity of composite index.
Use |
time |
a vector of temporal factors for indicators. The length of |
ref.time |
a value denoting the reference time for weighting. If provided, weights will be derived using only observations at the reference time. |
only.ci |
a logical value indicating whether only the composite index should be returned. |
The defaut method is "equal" that produces equal weights where
is the number of indicators. For methods "gini" (Gini-based
weighting) and "reci" (reciprocal Gini-based weighting), weights are
defined based on the Gini coefficient of indicators. Let be the
Gini coefficient of the -th indicator, the weights by methods
"gini" and "reci" are respectively computed as
and
.
Temporal factors can be applied to methods "gini" and "reci". If either
time or ref.time is NULL, the weighting process is run on all
observations. If both time and ref.time are not NULL, only observations
at the reference time are used for weight computation.
When aggregating the indicators, the aggregate score for the -th unit
is computed by applying the chosen aggregation function with the obtained
weights to values in the -th row. If hv = TRUE, horizontal
variability adjustment is executed by introducing a penalty for units with
unbalanced values among dimensions. The penalty for the -th unit is
defined as the the index of dispersion (variance-to-mean ratio) of values in
the -th row. If ci.pol = "pos", the penalties is subtracted from the
aggregate scores to form the composite index. If ci.pol = "neg" the
penalties is added to the aggregate scores to form the composite index.
A list containing the following components:
ci |
the composite index. |
w |
the weights assigned. |
pen |
the horizontal variability penalties (if |
If only.ci = TRUE, the function will return only the composite index.
Methods "gini" and "reci" require non-negative indicators for the
calculation of Gini coefficients. In addition, option hv = TRUE cannot be
used if any row contains negative values. Therefore, it may be necessary to
use normalize to scale the indicators to non-negative ranges before
computing the composite index.
A Gini coefficient of zero occurs when the indicators are constant or do not
change over the reference time. If a zero Gini coefficient is obtained for
for one or more indicators, method "gini" returns the corresponding weights
as zero while method "reci" cannot be applied.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
Gini, C. (1914). Sulla misura della concentrazione e della variabilita dei caratteri. Atti del Reale Istituto Veneto di Scienze, Lettere ed Arti, 62(5), 1203–1248.
Mazziotta, M., & Pareto, A. (2016). On a Generalized Non-compensatory Composite Index for Measuring Socio-economic Phenomena. Social Indicators Research, 127, 983–1003.
Ciommi, M., Gigliarano, C., Emili, A., Taralli, S., & Chelli, F. M. (2017). A new class of composite indicators for measuring well-being at the local level: An application to the Equitable and Sustainable Well-being (BES) of the Italian Provinces. Ecological Indicators, 76, 281–296.
data(bli) # Indicator polarity bli.pol = c("neg", "pos", "pos", "pos", "pos", "neg", "pos", "pos", "pos", "neg", "pos") # Goalpost normalization without using time factors bli.norm <- normalize(inds = bli[, 3:13], method = "goalpost", ind.pol = bli.pol) # Goalpost normalization using time factors and a reference time bli.norm.2014 <- normalize(inds = bli[, 3:13], method = "goalpost", ind.pol = bli.pol, time = bli$YEAR, ref.time = 2014) # Adjusted Mazziotta-Pareto index bli.ampi <- giniCI(bli.norm, ci.pol = "pos") bli.ampi$ci # Gini-based weighted arithmetic mean with reference time bli.gini <- giniCI(bli.norm.2014, method = "gini", ci.pol = "pos", time = bli$YEAR, ref.time = 2014) bli.gini$ci bli.gini$w # Reciprocal Gini-based weighted geometric mean with reference time bli.reci <- giniCI(bli.norm.2014, method = "reci", agg = "geo", ci.pol = "pos", time = bli$YEAR, ref.time = 2014) bli.reci$ci bli.reci$wdata(bli) # Indicator polarity bli.pol = c("neg", "pos", "pos", "pos", "pos", "neg", "pos", "pos", "pos", "neg", "pos") # Goalpost normalization without using time factors bli.norm <- normalize(inds = bli[, 3:13], method = "goalpost", ind.pol = bli.pol) # Goalpost normalization using time factors and a reference time bli.norm.2014 <- normalize(inds = bli[, 3:13], method = "goalpost", ind.pol = bli.pol, time = bli$YEAR, ref.time = 2014) # Adjusted Mazziotta-Pareto index bli.ampi <- giniCI(bli.norm, ci.pol = "pos") bli.ampi$ci # Gini-based weighted arithmetic mean with reference time bli.gini <- giniCI(bli.norm.2014, method = "gini", ci.pol = "pos", time = bli$YEAR, ref.time = 2014) bli.gini$ci bli.gini$w # Reciprocal Gini-based weighted geometric mean with reference time bli.reci <- giniCI(bli.norm.2014, method = "reci", agg = "geo", ci.pol = "pos", time = bli$YEAR, ref.time = 2014) bli.reci$ci bli.reci$w
Perform normalization based on indicators' polarity.
normalize(inds, method = c("min-max", "goalpost"), ind.pol, gp.range = c(70, 130), time = NULL, ref.time = NULL, ref.value = NULL)normalize(inds, method = c("min-max", "goalpost"), ind.pol, gp.range = c(70, 130), time = NULL, ref.time = NULL, ref.value = NULL)
inds |
a numeric vector, matrix, or data frame which provides indicators to be normalized. |
method |
normalization method to be used. See ‘Details’. |
ind.pol |
a character vector whose elements can be |
gp.range |
a vector of the form |
time |
a vector of temporal factors for input indicators. The length of
|
ref.time |
a value denoting the reference time for normalization. See ‘Details’. |
ref.value |
a vector containing reference values for indicators to
facilitate the interpretation of results, required by method |
By default, each indicator is normalized by method "min-max" with
the formulas
or
where and are respectively the
superior and inferior values of the indicator. The former formula is applied
to indicators with positive polarity while the latter one is used for those
with negative polarity.
If either time or ref.time is NULL, the superior and inferior values
are respectively the maximum and minimum values of . If both time
and ref.time are not NULL, the superior and inferior values are
respectively the maximum and minimum values of observed at the
reference time. In other words, if time is not provided or provided without
specifying a value for ref.time, the input data will be treated as
cross-sectional.
For method "goalpost", a vector of reference values for indicators is
required. If not specified by users (ref.value = NULL), these values are
automatically set #' to the indicator means for cross-sectional data or to
the indicator means at the reference time for longitudinal data.
Method "goalpost" computes two goalposts for normalization as
and
, where
is the reference value of and
. Indicators with
positive polarity are rescaled using the formula
while indicators with negative polarity are rescaled using the formula
If an indicator follows a symmetric probability distribution and its
reference value is set to the mean, the normalized values will theoretically
remain in the range . In other cases, the normalized values may
extend beyond gp.range.
An object of class "data.frame" containing normalized indicators.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
Mazziotta, M., & Pareto, A. (2016). On a Generalized Non-compensatory Composite Index for Measuring Socio-economic Phenomena. Social Indicators Research, 127, 983–1003.
# Generate data samples set.seed(1) df1 <- data.frame(X1 = rnorm(100, 0, 5), X2 = runif(100, 1, 10), X3 = rpois(100, 10)) set.seed(1) df2 <- data.frame(X1 = rnorm(300, 0, 5), X2 = runif(300, 1, 10), X3 = rpois(300, 10), time = rep(c(2020:2022), rep(100,3))) # Min-max normalization df1.mm <- normalize(inds = df1, ind.pol = c("pos", "neg", "pos")) summary(df1.mm) df2.mm <- normalize(inds = df2[, 1:3], ind.pol = c("pos", "neg", "pos"), time = df2[, 4], ref.time = 2020) summary(df2.mm) # Goalpost normalization df1.gp <- normalize(inds = df1, method = "goalpost", ind.pol = c("pos", "neg", "pos")) summary(df1.gp) df2.gp <- normalize(inds = df2[, 1:3], method = "goalpost", ind.pol = c("pos", "neg", "pos"), time = df2[, 4], ref.time = 2020) summary(df2.gp)# Generate data samples set.seed(1) df1 <- data.frame(X1 = rnorm(100, 0, 5), X2 = runif(100, 1, 10), X3 = rpois(100, 10)) set.seed(1) df2 <- data.frame(X1 = rnorm(300, 0, 5), X2 = runif(300, 1, 10), X3 = rpois(300, 10), time = rep(c(2020:2022), rep(100,3))) # Min-max normalization df1.mm <- normalize(inds = df1, ind.pol = c("pos", "neg", "pos")) summary(df1.mm) df2.mm <- normalize(inds = df2[, 1:3], ind.pol = c("pos", "neg", "pos"), time = df2[, 4], ref.time = 2020) summary(df2.mm) # Goalpost normalization df1.gp <- normalize(inds = df1, method = "goalpost", ind.pol = c("pos", "neg", "pos")) summary(df1.gp) df2.gp <- normalize(inds = df2[, 1:3], method = "goalpost", ind.pol = c("pos", "neg", "pos"), time = df2[, 4], ref.time = 2020) summary(df2.gp)
Perform a ranking comparison between two indices.
rankComp(ref, alt, highest.first = TRUE, id = NULL, time = NULL)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)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)
Generate rank-rank plots for ranking comparison.
rankRankPlot(object, id.col = FALSE, p.size = 1.5, p.nudge = 0.05, s.width = 0.5, lab.size = 3.88, max.overlaps = 10, max.tick = 50, ref.lab = "Reference ranking", alt.lab = "Alternative ranking", y.lab = NULL, combine = FALSE, nr = NULL, nc = NULL)rankRankPlot(object, id.col = FALSE, p.size = 1.5, p.nudge = 0.05, s.width = 0.5, lab.size = 3.88, max.overlaps = 10, max.tick = 50, ref.lab = "Reference ranking", alt.lab = "Alternative ranking", y.lab = NULL, combine = FALSE, nr = NULL, nc = NULL)
object |
an object of class |
id.col |
a logical value indicating whether the rank-rank segment should be colored by unit identifiers. It is not recommended if having more than 20 units. |
p.size |
size of segment endpoints. |
p.nudge |
horizontal adjustment value to nudge the starting position of labels. |
s.width |
line width for rank-rank segments. |
lab.size |
label size value. |
max.overlaps |
a value to exclude the label if it has too many overlaps.
The default value is |
max.tick |
a positive integer to control the maximum number of axis
ticks. The default value is |
ref.lab |
name of the reference index. |
alt.lab |
name of the alternative index. |
y.lab |
label of the y-axis. |
combine |
a logical value indicating whether to generate a grid that
combines plots from different time factors (If |
nr |
(optional) number of rows in the plot grid. |
nc |
(optional) number of columns in the plot grid. |
A plot comparing two rankings connected by segments. In case object$time
is not NULL, a list of plots for different time factors and the combined
grid (if combine = TRUE) will be returned. The function does not print the
return if it is assigned to an object. Use print with the storing object
to generate the plot.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
rankComp, rankScatterPlot, rankShiftPlot.
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 plots ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR) rankScatterPlot(ci.comp)$'2014' rankShiftPlot(ci.comp)$'2015' rankRankPlot(ci.comp)$'2016' # Storing and printing p.scatter <- rankScatterPlot(ci.comp, combine = TRUE, max.overlaps = 20) print(p.scatter$'2017') # or: print(p.scatter[[4]]) print(p.scatter$'comb') # or: print(p.scatter[[5]])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 plots ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR) rankScatterPlot(ci.comp)$'2014' rankShiftPlot(ci.comp)$'2015' rankRankPlot(ci.comp)$'2016' # Storing and printing p.scatter <- rankScatterPlot(ci.comp, combine = TRUE, max.overlaps = 20) print(p.scatter$'2017') # or: print(p.scatter[[4]]) print(p.scatter$'comb') # or: print(p.scatter[[5]])
Generate rank scatter plots for ranking comparison.
rankScatterPlot(object, p.col = "black", p.size = 1.5, p.shape = 19, lab = TRUE, lab.col = "red", lab.size = 3.88, ref.line = TRUE, max.overlaps = 10, max.tick = 50, ref.lab = "Reference ranking", alt.lab = "Alternative ranking", combine = FALSE, nr = NULL, nc = NULL)rankScatterPlot(object, p.col = "black", p.size = 1.5, p.shape = 19, lab = TRUE, lab.col = "red", lab.size = 3.88, ref.line = TRUE, max.overlaps = 10, max.tick = 50, ref.lab = "Reference ranking", alt.lab = "Alternative ranking", combine = FALSE, nr = NULL, nc = NULL)
object |
an object of class |
p.col |
point color code. See ‘Color Specification’
in |
p.size |
point size value. |
p.shape |
point shape value. See ‘pch values’ in |
lab |
a logical value indicating whether identifier labels should be
assigned to scatter points. If |
lab.col |
color code for labels. See ‘Color Specification’ in
|
lab.size |
label size value. |
ref.line |
a logical value indicating whether a 45-degree reference line should be added to the plot. |
max.overlaps |
a value to exclude the label if it has too many overlaps.
The default value is |
max.tick |
a positive integer to control the maximum number of axis
ticks. The default value is |
ref.lab |
name of the reference index. |
alt.lab |
name of the alternative index. |
combine |
a logical value indicating whether to generate a grid that
combines plots from different time factors (If |
nr |
(optional) number of rows in the plot grid. |
nc |
(optional) number of columns in the plot grid. |
A scatter plot displaying unit rankings for two indices. In case object$time
is not NULL, a list of plots for different time factors and the combined
grid (if combine = TRUE) will be returned. The function does not print the
return if it is assigned to an object. Use print with the storing object
to generate the plot.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
rankComp, 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 plots ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR) rankScatterPlot(ci.comp)$'2014' rankShiftPlot(ci.comp)$'2015' rankRankPlot(ci.comp)$'2016' # Storing and printing p.scatter <- rankScatterPlot(ci.comp, combine = TRUE, max.overlaps = 20) print(p.scatter$'2017') # or: print(p.scatter[[4]]) print(p.scatter$'comb') # or: print(p.scatter[[5]])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 plots ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR) rankScatterPlot(ci.comp)$'2014' rankShiftPlot(ci.comp)$'2015' rankRankPlot(ci.comp)$'2016' # Storing and printing p.scatter <- rankScatterPlot(ci.comp, combine = TRUE, max.overlaps = 20) print(p.scatter$'2017') # or: print(p.scatter[[4]]) print(p.scatter$'comb') # or: print(p.scatter[[5]])
Generate rank shift plots for ranking comparison.
rankShiftPlot(object, p.cols = c("black", "red"), p.shapes = c(1, 8), p.sizes = c(1.5, 1.5), s.col = "black", s.type = 1, s.width = 0.5, max.tick = 50, ref.lab = "Reference ranking", alt.lab = "Alternative ranking", y.lab = "Ranking", combine = FALSE, nr = NULL, nc = NULL)rankShiftPlot(object, p.cols = c("black", "red"), p.shapes = c(1, 8), p.sizes = c(1.5, 1.5), s.col = "black", s.type = 1, s.width = 0.5, max.tick = 50, ref.lab = "Reference ranking", alt.lab = "Alternative ranking", y.lab = "Ranking", combine = FALSE, nr = NULL, nc = NULL)
object |
an object of class |
p.cols |
a vector with two elements denoting the color codes for
reference and alternative positions. See ‘Color Specification’ in
|
p.shapes |
a vector with two elements denoting the shapes for reference
and alternative positions. See ‘pch values’ in |
p.sizes |
a vector with two elements denoting the sizes for reference and alternative positions. |
s.col |
color code for rank shift segments. See ‘Color
Specification’ in |
s.type |
line type for rank shift segments. See ‘Line Type
Specification’ in |
s.width |
line width for rank shift segments. |
max.tick |
a positive integer to control the maximum number of axis
ticks. The default value is |
ref.lab |
name of the reference index. |
alt.lab |
name of the alternative index. |
y.lab |
label of the y-axis. |
combine |
a logical value indicating whether to generate a grid that
combines plots from different time factors (If |
nr |
(optional) number of rows in the plot grid. |
nc |
(optional) number of columns in the plot grid. |
A plot displaying shifts in ranking between two indices. In case object$time
is not NULL, a list of plots for different time factors and the combined
grid (if combine = TRUE) will be returned. The function does not print the
return value if it is assigned to an object. Use print with the storing
object to produce the plot.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
rankComp, rankScatterPlot, 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 plots ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR) rankScatterPlot(ci.comp)$'2014' rankShiftPlot(ci.comp)$'2015' rankRankPlot(ci.comp)$'2016' # Storing and printing p.scatter <- rankScatterPlot(ci.comp, combine = TRUE, max.overlaps = 20) print(p.scatter$'2017') # or: print(p.scatter[[4]]) print(p.scatter$'comb') # or: print(p.scatter[[5]])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 plots ci.comp <- rankComp(ci.gini, ci.reci, id = bli$COUNTRY, time = bli$YEAR) rankScatterPlot(ci.comp)$'2014' rankShiftPlot(ci.comp)$'2015' rankRankPlot(ci.comp)$'2016' # Storing and printing p.scatter <- rankScatterPlot(ci.comp, combine = TRUE, max.overlaps = 20) print(p.scatter$'2017') # or: print(p.scatter[[4]]) print(p.scatter$'comb') # or: print(p.scatter[[5]])
Summary method for class "rankComp" and print method for class
"summary.rankComp".
## S3 method for class 'rankComp' summary(object, n.pick = 10L, n.q = 10L, ...) ## S3 method for class 'summary.rankComp' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'rankComp' summary(object, n.pick = 10L, n.q = 10L, ...) ## S3 method for class 'summary.rankComp' print(x, digits = max(3L, getOption("digits") - 3L), ...)
object |
an object of class |
n.pick |
a positive integer specifying the number of units considered to
form the top/bottom based on the alternative index. The default value is |
n.q |
a positive integer specifying the n-quantiles considered
to compute quantile rankings. The default value is |
... |
further arguments passed to or from other methods. |
x |
an object of class |
digits |
number of significant digits to use when printing. |
summary.rankComp provides details on the ranking comparison between the
reference and the alternative indices stored in the object of class
"rankComp". print.summary.rankComp prints summary information using a
smart digit format for the components.
An object of class "summary.rankComp" which is a list of components:
par |
a vector storing the values of |
n.unit |
the number of ranked units (by temporal factors if available). |
shift.stats |
a data frame with rows presenting the summary statistics of ranking shifts: minimum, first quartile, median, mean, third quartile, and maximum. |
asr |
a data frame giving the average shift in ranking (ASR)
where |
per |
a data frame giving the percentage of equal rankings (PER)
where |
asq |
the average shift in quantile ranking (by temporal factors if available). This value is similar to the ASR for all units, but using the quantile ranking of two indices. |
For shift.stats, asr, and per, multiple columns will be generated
according to temporal factors if object$time is not NULL.
Viet Duong Nguyen, Chiara Gigliarano, Mariateresa Ciommi
Mariani, F., Ciommi, M., & Recchioni, M. C. (2024). Two in One: A New Tool to Combine Two Rankings Based on the Voronoi Diagram. Social Indicators Research, 175, 989–1005.
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)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)