当前位置:网站首页>How to calculate the Gini coefficient in R (with examples)

How to calculate the Gini coefficient in R (with examples)

2022-06-22 20:53:00 Mrrunsen

Italian statisticians Corrado Gini name , The Gini coefficient is a measure of income distribution .

The value of Gini coefficient is 0 To 1 Between , The higher the value, the greater the income inequality , among :

0 On behalf of full income equality ( Everyone has the same income )
1 Represents total income inequality ( One person has all the income )
You can find by country... Here / List of Gini coefficients listed by Region .

The following example shows the use of DescTools In bag Gini() Function calculation R Two methods of Gini coefficient in .

Example 1: Use personal income to calculate Gini coefficient

Suppose we have the following 10 Personal annual income list :

income :5 Thousands of dollars 、5 Thousands of dollars 、7 Thousands of dollars 、7 Thousands of dollars 、7 Thousands of dollars 、9 Thousands of dollars 、15 Thousands of dollars 、15 Thousands of dollars 、15 Thousands of dollars 、15 Thousands of dollars

The following code shows how to use Gini() Function to calculate the Gini coefficient of the population :

library(DescTools)

#define vector of incomes
x <- 
原网站

版权声明
本文为[Mrrunsen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221917181794.html