Last data update: 2014.03.03

R: Extended Gini Coefficient
calcSGiniR Documentation

Extended Gini Coefficient

Description

Computes the Extended Gini coefficient for a vector.

Usage

calcSGini(x, w = NULL, param = 2)

Arguments

x

Numeric vector with non-negative values.

w

Numeric vector of sampling weigths (optional).

param

Parameter specifying the extended Gini index (must be strictly positive).

Value

A list of class "ICI" with components:

ineq

a list with components SGini (value of inequality index) and param (value of parameter).

nas

a list with NA counts, including components xNA, wNA and totalNA.

References

Cowell F.A. (2000) Measurement of Inequality. In Atkinson A.B., Bourguignon F. (Eds.) Handbook of Income Distribution. Amsterdam, Elsevier, Vol. 1, pp. 87-166.

Schechtman E., Yitzhaki S. (2008) Calculating the Extended Gini Coefficient from Grouped Data: A Covariance Presentation. Bulletin of Statistics & Economics, 2(S08), pp. 64-69.

See Also

decompSGini, curveLorenz

Examples

data(hhbudgets)

calcSGini(hhbudgets[,"ingreso"], param=0.5)
summary(hhbudgets[,"mantenimiento"])
calcSGini(hhbudgets[,"mantenimiento"], w=hhbudgets[,"factor"])

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IC2)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IC2/calcSGini.Rd_%03d_medium.png", width=480, height=480)
> ### Name: calcSGini
> ### Title: Extended Gini Coefficient
> ### Aliases: calcSGini
> 
> ### ** Examples
> 
> data(hhbudgets)
> 
> calcSGini(hhbudgets[,"ingreso"], param=0.5)
$ineq
$ineq$index
    SGini 
-2.039703 

$ineq$parameter
param 
  0.5 


$nas
$nas$xNA
[1] 0

$nas$wNA
NULL

$nas$totalNA
[1] 0


attr(,"class")
[1] "ICI"
> summary(hhbudgets[,"mantenimiento"])
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
      0       0       0    1374    2103   32990 
> calcSGini(hhbudgets[,"mantenimiento"], w=hhbudgets[,"factor"])
$ineq
$ineq$index
    SGini 
0.7640905 

$ineq$parameter
param 
    2 


$nas
$nas$xNA
[1] 0

$nas$wNA
[1] 0

$nas$totalNA
[1] 0


attr(,"class")
[1] "ICI"
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>