gini_corr {GiniDecompLY}R Documentation

Gini correlation index

Description

This function calculates the Gini correlation between two distributions.

Usage

gini_corr(x, y, weights = NULL)

Arguments

x

a numeric vector containing at least non-negative elements.

y

a numeric vector containing the distribution with the rank information.

weights

an optional vector of weights to apply in computation. Should be NULL or a numeric vector.

Value

The value of the Gini correlation, should be between -1 and 1.

References

E. Schechtman and S. Yitzhaki (1999) On the proper bounds of the Gini correlation, Economics Letters,Volume 63, Issue 2, p. 133-138, ISSN 0165-1765

Handcock, M. (2016), Relative Distribution Methods in the Social Sciences, Springer-Verlag, Inc., New York, 1999 ISBN 0387987789

Examples


# Calculate the gini correlation between the salary and total income distributions


Salary_distribution = sample_income_data$wage
Total_income_distribution = rowSums(sample_income_data[3:6])

gini_corr(Salary_distribution, Total_income_distribution)



[Package GiniDecompLY version 1.0.0 Index]