plot.inequality_curves: Plot inequality curves

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

View source: R/plot.inequality_curves.R

Description

Method of the generic plot for objects generated by the function inequalityCurves.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## S3 method for class 'inequality_curves'
plot(
  x,
  pch = 16,
  from = 0,
  to = 1,
  xlim = NULL,
  ylim = NULL,
  xaxs = "i",
  yaxs = "i",
  xlab = "p",
  ylab = NULL,
  main = attributes(x)$index,
  sub = paste0(
    "grp: ",
    paste(attributes(x)$groups, collapse = ", "),
    "; src: ",
    paste(attributes(x)$sources, collapse = ", ")
  ),
  ...
)

Arguments

x

Object of class "decomposition".

pch

A vector of plotting characters or symbols: see points.

from, to

The range over which the function will be plotted.

xlim

The x limits (x1, x2) of the plot. The default value, NULL, indicates that the range of the function should be used.

ylim

the y limits of the plot.

xaxs

The style of axis interval calculation to be used for the x-axis. See par for details.

yaxs

The style of axis interval calculation to be used for the y-axis. See xaxs above.

xlab

a title for the x axis: see title.

ylab

a title for the y axis: see title.

main

an overall title for the plot: see title.

sub

a sub title for the plot: see title.

...

Arguments to be passed to methods, such as graphical parameters (see par). Many methods will accept the following arguments:

Details

This method is a convenience wrapper for plotting inequality curves. Default values of the plot are modified in order to plot inequality curves in the unitary square. Moreover, the default value of the argument sub shows in the plot if the curve represents the whole inequality or a contribution.

Value

The same output of the function plot.stepfun, a list with two components:

t

abscissa (x) values, including the two outermost ones.

y

y values ‘in between’ the t[].

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

plot, graphical parameters, par, plot.stepfun, inequalityCurves

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)
contrib1 <- inequalityCurves(decomposition, l = 1)
contrib12 <- inequalityCurves(decomposition, l = 1:2)

plot(ic)
plot(contrib1, add = TRUE)
plot(contrib12, add = TRUE)
text(0.1, 1/6+0:2/3, labels = c("G1", "G2", "G3"))

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