Stata:各类集中度指数估算-广义基尼Gini系数

发布时间:2021-01-19 阅读 9645

Stata连享会   主页 || 视频 || 推文 || 知乎

温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。

New! lianxh 命令发布了:
随时搜索连享会推文、Stata 资源,安装命令如下:
. ssc install lianxh
使用详情参见帮助文件 (有惊喜):
. help lianxh

课程详情 https://gitee.com/arlionn/Course   |   lianxh.cn

课程主页 https://gitee.com/arlionn/Course

作者: 杜孟凡 (湖南大学)
邮箱: dumengfan0707@163.com


目录


Source: 本文根据如下论文翻译整理而得,特此致谢!
Owen O'Donnell, Stephen O'Neill, Tom Van Ourti, Brendan Walsh, 2016, Conindex: Estimation of Concentration Indices, Stata Journal, 16(1): 112–138. -PDF-, -PDF2-

1. 背景介绍

「集中度指数」 衡量的是一个变量相对于另一个变量的分布的不平等 (Kakwani, 1977) ,为评估不平等,标准集中度指数与广义集中度指数等多种集中度指标已被提出。

本推文将要介绍的 conindex 命令提供了一种简单的统一方法来估算各种集中度指数及其标准误差。 它可以测量基本变量的横截面不平等,也可以比较重复的横截面或面板数据各个时期的不平等,还可以用它来估计单变量不平等的等级相关指数,例如「基尼系数」和「广义基尼系数」。

与其他计算等级相关的不平等指数的命令,如 concindc (Chen, 2007) 和 glcurve (van Kerm 和 Jenkins, 2007) 等相比, conindex 命令估计了一系列集中度指标,这使分析人员可以选择一个适合所关注变量的测量属性的指标,并且该指标应符合其关于不平等性的规范性原则。

2. 集中度指数

2.1 理论部分

conindex 命令可以计算的各种不平等指数, 为了简化说明,将兴趣变量称为健康,将排名变量称为收入,则与收入相关的健康不平等状况可以通过绘制从最贫穷到最富有的个人的健康累积比例来进行评估。具体的集中度指数测度定义如下:

其中,

  • hi 是用于衡量不平等的变量,例如,健康。
  • C 的范围从 (1n)/n,即最大的“亲贫” (pro-poor) 不平等 (也就是说,所有健康都集中在最贫穷的个体上) 到 (n1)/n,即最大的“亲富” (pro-rich) 不平等。

公式 (1) 显示,集中度指数可以解释为 (健康) 份额的加权平均值,其权重取决于分数 (收入) 等级 (2Ri1)

当在用于排名的同一变量中测量不平等时,单变量不平等的基尼系数度量作为集中指数的一种特殊情况出现。以上标准集中指数衡量相对不平等,并且对于关注变量 (健康) 的等比例变化是不变的。但在另一个极端,绝对不变性对应于不平等度量,当两个分布显示相对不平等的水平相同时,均值越高的绝对不平等就越大。广义集中度指数 GC 可以表示为:

范围介于 h¯{(1n)/n} (最亲贫) 和 h¯{(n1)/n} (最亲富) 之间。

在测量水平允许对感兴趣变量进行转换 (标量,序数,基数,比率或固定比例) 的情况下,标准集中度指数和广义集中度指数不一定是不变的或相等的,还可以演化出:

  • 广义 (基尼) 集中度指数
  • 修正集中度指数
  • Wagstaff 和 Erreygers 归一化集中度指数
  • ……

就在这里就不一一详细介绍,感兴趣的可以参考 Owen O’Donnell et al. (2016) 的文章。

2.2 推断与估计

实际上,每个与等级相关的不平等指数都可以表示为关注变量 (hi) 与排序变量的分数等级 (Ri) 之间的协方差的转换。例如,标准集中度指数等于相关变量的均值除以协方差的两倍[见公式(1)]。 而简单最小二乘回归的斜率系数是协方差除以回归元的方差,所以每个不平等指标都可以通过对目标变量在等级上的变换进行回归得到。 例如,标准集中度指数是对如下回归模型中系数 α1 的最小二乘估计:

其中,σR2 是 R 的方差,而 ϵi 是误差项。α1 的最小二乘估计标准误差用作集中度指数的估计标准误差。

3. conindex 命令语法与实例

3.1 命令语法

conindex 的第一版本发布于 2016 年,目前更新版为 2018 版本。输入 findit conindex 可以搜索到该命令的最新版本,找到最新版本后,点击 (click here to install) 即可。亦可使用命令来安装:

. net install st0427_2.pkg

完成安装后,输入 help conindex 即可查看其完整帮助文件。

conindex 的语法语法结构如下:


 conindex [varlist] [if] [in] [fweight aweight pweight],
          RANKvar(varname) [CLUSter(varname)] [robust] [truezero]
          [generalized] [v(#1)] [beta(#1)] [bounded]
          [LIMits(#1 #2)] [WAGstaff] [ERReygers]
          [graph] [loud] [COMPare(varname)]
          [KEEPrank(string)] [svy]

没有默认要计算的指数,要通过选项定义要计算的指数,例如,广义集中度指数是通过同时指定 truezero 选项和 generalized 选项而得出的,其他指数的具体指定说明可参考 Owen O’Donnell 等 (2016) 的文章,也可以通过在 stata 命令窗口输入 help conindex 命令得到。 同时,可以使用 graph 选项获得 (广义的) Lorenz 和 (广义的) 集中度曲线,也可以使用 xtitle()ytitle() 选项设定横坐标和纵坐标的标题。

3.2 Stata 实例

由于 Owen O’Donnell 等 (2016) 所使用的示例数据无法获取,下面我们使用模拟数据说明 conindex 的功能,具体命令如下:

Note: 下面的模拟过程中,未设定种子值。因此,你自己测试的时候,结果会与我们呈现的结果略有差异。


. clear
. set obs 1000 //设定1000个观测值

//生成两个模拟变量 
. gen rank = _n
. gen Y1   = invnormal(uniform())^2

//标准集中度估计
. conindex Y1, truezero rankvar(rank) 
-------------------------------------------------------------+
Index:  | No. of obs. | Index value | Std. error  | p-value  |
--------+-------------+-------------+-------------+----------|
CI      | 1000        | .04350093   |.02544088    |  0.0876  |
-------------------------------------------------------------+

 
//广义集中度估计
. conindex Y1, generalized truezero rankvar(rank)
-------------------------------------------------------------+
Index:  | No. of obs. | Index value | Std. error  | p-value  |
--------+-------------+-------------+-------------+----------|
Gen. CI | 1000        | .04519981   |.02643444    |  0.0876  |
-------------------------------------------------------------+

//生成受限变量 ,也就是有上下限的变量
. gen BinaryY=invnormal(uniform())>0

. sum BinaryY
 Variable |    Obs   Mean   Std. Dev.   Min   Max
----------+--------------------------------------
  BinaryY |  1,000   .466   .4990923      0     1

//此时,需要指定bounded和limits选项
. conindex BinaryY, bounded limits(0 1) rankvar(rank)
--------------------------------------------------------------+
Index:    | No. of obs. | Index value | Std. error | p-value  |
----------+-------------+-------------+------------+----------|
CI        | 1000        | -.01971674  |.01955377   |  0.3135  |
--------------------------------------------------------------+

//也可以通过指定wagstaff和erreygers选项来获得归一化浓度指数
. conindex BinaryY, bounded limits(0 1) wagstaff rankvar(rank)
-----------------------------------------------------------------------+
Index:             | No. of obs. | Index value | Std. error | p-value  |
-------------------+-------------+-------------+------------+----------|
Wagstaff norm. CI  | 1000        | -.03692273  |.03661754   |  0.3135  |
-----------------------------------------------------------------------+

. conindex BinaryY, bounded limits(0 1) erreygers rankvar(rank)
-----------------------------------------------------------------------+
Index:             | No. of obs. | Index value | Std. error | p-value  |
-------------------+-------------+-------------+------------+----------|
Erreygers norm. CI | 1000        | -.036752    |.03644822   |  0.3135  |
-----------------------------------------------------------------------+

除了返回点估计的结果之外, conindex 还返回一个聚类调整后的标准误差和一个 p 值,用于检验指数等于 0 的原假设,在上述示例中,均未拒绝原假设,表明上述模拟变量并不存在显著的集中趋势,即不平等性。

4. 结语

conindex 可以计算与等级相关的不平等指数,同时在考虑度量范围时提供了很大的灵活性,该命令的估计和推论是通过回归方法进行的,该方法也可以进行抽样设计,分组数据,并可以检验总体之间的不平等差异。

现有文献经常使用集中度指数,特别是用于通过社会经济地位衡量健康方面的不平等的相关研究,此外,为不同区域,时期或组估算的集中度指标也可以作为控制变量纳入回归分析中。

5. 附录:作者提供的范例 dofile

Owen O'Donnell, Stephen O'Neill, Tom Van Ourti, Brendan Walsh, 2016, Conindex: Estimation of Concentration Indices, Stata Journal, 16(1): 112–138. -PDF-, -PDF2-

作者提供的范例 dofile 可以使用如下命令获取:

. net get st0427_1.pkg

为便于查看,这里放上一份副本:

**************************************
* Data
**************************************
* The data used in the examples can be downloaded after registration from The DHS Program website: 
* http://www.dhsprogram.com/data/dataset_admin/login_main.cfm?logout=&CFID=8679569&CFTOKEN=40f990b41b421b7e-9C675AF9-9325-ECB7-18E9AA5A272CE050

**************************************
* Indices in Table 1 for healthexp:
**************************************
use "CDHS2010hh.dta", clear
sum healthexp [aweight=sampweight_hh]
xtile wealthquint_hh = wealthindex [pweight=sampweight_hh], n(5)
graph bar (mean) healthexp [pweight = sampweight_hh], over(wealthquint_hh)
conindex healthexp [aweight=sampweight_hh], rankvar(wealthindex) truezero cluster(PSU) graph ytitle(Cumulative share of healthexp) xtitle(Fractional Income rank)
conindex healthexp [aweight=sampweight_hh], rankvar(wealthindex) generalized truezero cluster(PSU) 
conindex healthexp [aweight=sampweight_hh], rankvar(wealthindex) v(1.5) truezero cluster(PSU)
conindex healthexp [aweight=sampweight_hh], rankvar(wealthindex) v(5) truezero cluster(PSU)
conindex healthexp [aweight=sampweight_hh], rankvar(wealthindex) beta(1.5) truezero cluster(PSU)
conindex healthexp [aweight=sampweight_hh], rankvar(wealthindex) beta(5) truezero cluster(PSU)

**************************************
* Indices in Table 1 for u1mr/u1sr:
**************************************
use "CDHS2010kids.dta", clear
sum u1mr [aweight=sampweight]
xtile wealthquint = wealthindex [pweight=sampweight], n(5)
graph bar (mean) u1mr [pweight = sampweight], over(wealthquint)
gen u1sr=1-u1mr
conindex u1mr [aweight=sampweight], rankvar(wealthindex) truezero cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) truezero cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) generalized truezero cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) generalized truezero cluster(PSU) 

conindex u1mr [aweight=sampweight], rankvar(wealthindex) erreygers bounded limits(0 1) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) erreygers bounded limits(0 1) cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) wagstaff bounded limits(0 1) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) wagstaff bounded limits(0 1) cluster(PSU) 

conindex u1mr [aweight=sampweight], rankvar(wealthindex) truezero v(1.5) cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) truezero beta(1.5) cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) truezero v(5) cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) truezero beta(5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) truezero v(1.5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) truezero beta(1.5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) truezero v(5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) truezero beta(5) cluster(PSU) 

conindex u1mr [aweight=sampweight], rankvar(wealthindex) generalized truezero v(1.5) cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) generalized truezero beta(1.5) cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) generalized truezero v(5) cluster(PSU) 
conindex u1mr [aweight=sampweight], rankvar(wealthindex) generalized truezero beta(5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) generalized truezero v(1.5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) generalized truezero beta(1.5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) generalized truezero v(5) cluster(PSU) 
conindex u1sr [aweight=sampweight], rankvar(wealthindex) generalized truezero beta(5) cluster(PSU) 

******************
* Compare Option:
******************
conindex u1mr [aweight=sampweight], rankvar(wealthindex) erreygers bounded limits(0 1) cluster(PSU) compare(urban)

bys urban: conindex u1mr [aweight=sampweight], rankvar(wealthindex) erreygers bounded limits(0 1) cluster(PSU) 

6. 参考资料

  • Owen O'Donnell, Stephen O'Neill, Tom Van Ourti, Brendan Walsh, 2016, Conindex: Estimation of Concentration Indices, Stata Journal, 16(1): 112–138. -PDF-
  • Kakwani, N., A. Wagstaff, and E. van Doorslaer. 1997. Socioeconomic inequalities in health: Measurement, computation, and statistical inference. Journal of Econometrics 77: 87–103. -PDF-
  • Chen, Z. A. 2007. concindc: Stata module to calculate concentration index with both individual and grouped data. Statistical Software Components S456802, Department of Economics, Boston College. -PDF-
  • van Kerm, P., and S. P. Jenkins. 2007. Software Updates: Generalized Lorenz curves and related graphs: Update for Stata 7. Stata Journal 7: 280.-PDF-
  • Bilger M., E.J. Kruger, and E.A. Finkelstein, 2016. Measuring Socioeconomic Inequality in Obesity: Looking Beyond the Obesity Threshold. Health Economics 24(1), 75-85. -PDF-. Stata 命令:fgt_ci.
  • Ben Jann, 2016, Estimating Lorenz and Concentration Curves, Stata Journal, 16(4): 837–866. -PDF-, -PDF2-
  • Philippe Van Kerm, Stephen P. Jenkins, 2001, Generalized Lorenz Curves and Related Graphs: An Update for Stata 7, Stata Journal, 1(1): 107–112. -PDF-

7. 相关推文

Note:产生如下推文列表的命令为:
lianxh hhi RIF, m
安装最新版 lianxh 命令:
ssc install lianxh, replace

相关课程

连享会-直播课 上线了!
http://lianxh.duanshu.com

免费公开课:


课程一览

支持回看

专题 嘉宾 直播/回看视频
最新专题 因果推断, 空间计量,寒暑假班等
数据清洗系列 游万海 直播, 88 元,已上线
研究设计 连玉君 我的特斯拉-实证研究设计-幻灯片-
面板模型 连玉君 动态面板模型-幻灯片-
面板模型 连玉君 直击面板数据模型 [免费公开课,2小时]

Note: 部分课程的资料,PPT 等可以前往 连享会-直播课 主页查看,下载。


关于我们

  • Stata连享会 由中山大学连玉君老师团队创办,定期分享实证分析经验。直播间 有很多视频课程,可以随时观看。
  • 连享会-主页知乎专栏,400+ 推文,实证分析不再抓狂。
  • 公众号关键词搜索/回复 功能已经上线。大家可以在公众号左下角点击键盘图标,输入简要关键词,以便快速呈现历史推文,获取工具软件和数据下载。常见关键词:课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法

连享会主页  lianxh.cn
连享会主页 lianxh.cn

连享会小程序:扫一扫,看推文,看视频……

扫码加入连享会微信群,提问交流更方便

✏ 连享会学习群-常见问题解答汇总:
https://gitee.com/arlionn/WD

New! lianxh 命令发布了:
随时搜索连享会推文、Stata 资源,安装命令如下:
. ssc install lianxh
使用详情参见帮助文件 (有惊喜):
. help lianxh