inequalityCurves: Inequality curves evaluation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/inequalityCurves.R

Description

Generates step-functions (see stepfun) representing inequality curves or sources/subpopulations point contributions in the decomposition x generated by functions gini, bonferroni or zenga.

Usage

1
2
3
inequalityCurves(x, ...)
## S3 method for class 'decomposition'
inequalityCurves(x, l = 1:dim(x$decomposition)[2], k = 1:dim(x$decomposition)[4], ...)

Arguments

x

An object of class decomposition output of functions gini, bonferroni, zenga.

l

Vector of selected subpopulations. If only one subpopulation is selected the resulting step function provides its point contributions. More than one subpopulation can be selected and contributions are cumulated. If empty all subpopulations are considered and contributions are marginalized by subpopulations.

k

Vector of selected sources. If only one source is selected the resulting step function provides its point contributions. More than one source can be selected and contributions are cumulated. If empty all sources are considered and contributions are marginalized by sources.

...

Potentially further arguments (required by the generic).

Details

By default generates step functions representing inequality curves of the whole population. If arguments l and/or k are defined, resuts are step functions representing point contributions of the selected subpopulations and/or sources.

The class of the result is "inequality_curves" that is associated to the method plot.inequality_curves for graphical representations. Such derived class hinerits the features of the "stepfun" class.

Value

An object of class "inequality_curves" hineriting the features of class "stepfun" with the following additional attributes:

index

String denoting computed index.

min, max

The range of values assumed by the function.

groups

Vector of names of the subpopulations partitioning the whole population .

sources

Vector of names of the all the sources that sum to the total variable Y.

selected_groups

Vector of names of the selected subpopulations to evaluate the point contributions.

selected_sources

Vector of names of the selected sources to evaluate the point contributions.

Author(s)

Alberto Arcagni, Igor Valli

References

Zenga M. M.(2007). Inequality Curve and Inequality Index based on the Ratios between llower and upper Means . Statistica and Applicazioni, V (1), 3-27.

Zenga M. (2015) Joint decomposition by subpopulations and sources of the point and synthetic Zenga(2007) Index I(Y). Statistica and Applicazioni, XIII (2), pp.163-195.

Zenga M., Valli I. (2017). Joint decomposition by Subpopulations and Sources of the Point and Synthetic Bonferroni Inequality Measures. Statistics and Applications, XV (2), pp. 83-120.

Zenga M., Valli I. (2018). Joint decomposition by Subpopulations and Sources of the Point and Synthetic Gini Indexes. Statistics and Applications, XVI (1).

See Also

See gini, bonferroni, zenga to obtain objects of class decomposition and see plot.inequality_curves for the graphical representation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
G <- c(1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 3, 3) # vector denoting group membership
X1 <- c(0, 0, 0, 500, 700, 300, 750, 1000, 500, 500, 500, 1000) # vector of the first source
X2 <- c(0, 0, 0, 500, 300, 700, 750, 500, 700, 700, 1000,600) # vector of the second source
data <- data.frame(G, X1, X2) # no sample weights are considered
x <- dataProcessing( # data preparation
  units = data[, c('X1', 'X2')],
  groups = data[, 'G'],
)
decomposition <- zenga(x)

ic <- inequalityCurves(decomposition)
ic
contrib1 <- inequalityCurves(decomposition, l = 1)
contrib1
contrib12 <- inequalityCurves(decomposition, l = 1:2)
contrib12

ineqJD documentation built on Sept. 20, 2019, 9:06 a.m.