Gini.coef {LorenzRegression} | R Documentation |
Concentration index of y wrt x
Description
Gini.coef
computes the concentration index of a vector y with respect to another vector x.
If y and x are identical, the obtained concentration index boils down to the Gini coefficient.
Usage
Gini.coef(
y,
x = y,
na.rm = TRUE,
ties.method = c("mean", "random"),
seed = NULL,
weights = NULL
)
Arguments
y |
variable of interest. |
x |
variable to use for the ranking. By default |
na.rm |
should missing values be deleted. Default value is |
ties.method |
What method should be used to break the ties in the rank index. Possible values are "mean" (default value) or "random". If "random" is selected, the ties are broken by further ranking in terms of a uniformly distributed random variable. If "mean" is selected, the average rank method is used. |
seed |
fixes what seed is imposed for the generation of the vector of uniform random variables used to break the ties. Default is NULL, in which case no seed is imposed. |
weights |
vector of sample weights. By default, each observation is given the same weight. |
Value
The value of the concentration index (or Gini coefficient)
See Also
Examples
data(Data.Incomes)
# We first compute the Gini coefficient of Income
Y <- Data.Incomes$Income
Gini.coef(y = Y)
# Then we compute the concentration index of Income with respect to Age
X <- Data.Incomes$Age
Gini.coef(y = Y, x = X)