lorenz.curve | R Documentation |
Plots the Lorenz curve that is a graphical representation of the cumulative distribution function. The user can choose between the Lorenz curve with single (default) or multiple weighting of data, for example, taking into account for single or multiple legislature representatives \insertCiteGastwirth_1972lawstat.
lorenz.curve(
data,
weight = NULL,
mul = FALSE,
plot.it = TRUE,
main = NULL,
xlab = NULL,
ylab = NULL,
xlim = c(0, 1),
ylim = c(0, 1),
...
)
data |
input data. If the argument is an array, a matrix, a data.frame, or a list
with two or more columns, then the first column will be treated as a data vector,
and the second column to be treated as a weight vector. A separate weight vector is
then ignored and not required. If the argument is a single column vector, then a user
must enter a separate single-column weight vector.
|
weight |
one-column vector contains factors of single or multiple weights.
Ignored if included in the |
mul |
logical value indicates whether the Lorenz curve with multiple weight
is to be plotted. Default is |
plot.it |
logical value indicates whether the Lorenz curve should be plotted.
Default is |
main |
title of Lorenz curve. Only required if user wants to override the default value. |
xlab |
label of x-axis. Only required if user wants to override the default value. |
ylab |
label of y-axis. Only required if user wants to override the default value. |
xlim |
plotting range of x-axis. Only required if user wants to override the default value. |
ylim |
plotting range of y-axis. Only required if user wants to override the default value. |
... |
other graphical parameters to be passed to the |
The input data should be a data frame with 2 columns. The first column will be treated as data vector, and the second column to be treated as a weight vector. Alternatively, data and weights can be entered as separate one-column vectors.
A Lorenz curve plot with x-axis being the culmulative fraction of the data argument, and y-axis being the culmulative fraction of the weight argument. In the legend to the plot, the following values are reported:
RMD |
relative mean deviation of the input data. |
GI |
the Gini index of the input data. |
L(1/2) |
median of the culmulative fraction sum of the data. |
Man Jin, Wallace W. Hui, Yulia R. Gel, Joseph L. Gastwirth
gini.index
## Data on: number of senators (second column) and
## representatives (third column) relative to population size (first column) in 1963
## First column is treated as the data argument.
data(data1963)
## Single weight Lorenz Curve using number of senators as weight argument.
lorenz.curve(data1963)
## Multiple weight Lorenz Curve using number of senators as weight argument.
lorenz.curve(data1963, mul = TRUE)
## Multiple weight Lorenz Curve using number of representatives
## as weight argument.
lorenz.curve(data1963[, "pop1963"], data1963[, "rep1963"], mul = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.