温馨提示: 定期 清理浏览器缓存,可以获得最佳浏览体验。
New!
lianxh
命令发布了:
随时搜索连享会推文、Stata 资源,安装命令如下:
. ssc install lianxh
使用详情参见帮助文件 (有惊喜):
. help lianxh
作者: 杜孟凡 (湖南大学)
邮箱: 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-
「集中度指数」 衡量的是一个变量相对于另一个变量的分布的不平等 (Kakwani, 1977) ,为评估不平等,标准集中度指数与广义集中度指数等多种集中度指标已被提出。
本推文将要介绍的 conindex
命令提供了一种简单的统一方法来估算各种集中度指数及其标准误差。 它可以测量基本变量的横截面不平等,也可以比较重复的横截面或面板数据各个时期的不平等,还可以用它来估计单变量不平等的等级相关指数,例如「基尼系数」和「广义基尼系数」。
与其他计算等级相关的不平等指数的命令,如 concindc
(Chen, 2007) 和 glcurve
(van Kerm 和 Jenkins, 2007) 等相比, conindex
命令估计了一系列集中度指标,这使分析人员可以选择一个适合所关注变量的测量属性的指标,并且该指标应符合其关于不平等性的规范性原则。
conindex
命令可以计算的各种不平等指数, 为了简化说明,将兴趣变量称为健康,将排名变量称为收入,则与收入相关的健康不平等状况可以通过绘制从最贫穷到最富有的个人的健康累积比例来进行评估。具体的集中度指数测度定义如下:
其中,
公式 (1) 显示,集中度指数可以解释为 (健康) 份额的加权平均值,其权重取决于分数 (收入) 等级
当在用于排名的同一变量中测量不平等时,单变量不平等的基尼系数度量作为集中指数的一种特殊情况出现。以上标准集中指数衡量相对不平等,并且对于关注变量 (健康) 的等比例变化是不变的。但在另一个极端,绝对不变性对应于不平等度量,当两个分布显示相对不平等的水平相同时,均值越高的绝对不平等就越大。广义集中度指数 GC 可以表示为:
范围介于
在测量水平允许对感兴趣变量进行转换 (标量,序数,基数,比率或固定比例) 的情况下,标准集中度指数和广义集中度指数不一定是不变的或相等的,还可以演化出:
就在这里就不一一详细介绍,感兴趣的可以参考 Owen O’Donnell et al. (2016) 的文章。
实际上,每个与等级相关的不平等指数都可以表示为关注变量 (
其中,
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()
选项设定横坐标和纵坐标的标题。
由于 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 的原假设,在上述示例中,均未拒绝原假设,表明上述模拟变量并不存在显著的集中趋势,即不平等性。
conindex
可以计算与等级相关的不平等指数,同时在考虑度量范围时提供了很大的灵活性,该命令的估计和推论是通过回归方法进行的,该方法也可以进行抽样设计,分组数据,并可以检验总体之间的不平等差异。
现有文献经常使用集中度指数,特别是用于通过社会经济地位衡量健康方面的不平等的相关研究,此外,为不同区域,时期或组估算的集中度指标也可以作为控制变量纳入回归分析中。
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)
fgt_ci
.
Note:产生如下推文列表的命令为:
lianxh hhi RIF, m
安装最新版lianxh
命令:
ssc install lianxh, replace
连享会-直播课 上线了!
http://lianxh.duanshu.com
免费公开课:
直击面板数据模型 - 连玉君,时长:1小时40分钟,课程主页 Stata 33 讲 - 连玉君, 每讲 15 分钟. Stata 小白的取经之路 - 龙志能,时长:2 小时,课程主页 部分直播课 课程资料下载 (PPT,dofiles等)
支持回看
专题 | 嘉宾 | 直播/回看视频 |
---|---|---|
⭐ 最新专题 | 因果推断, 空间计量,寒暑假班等 | |
⭕ 数据清洗系列 | 游万海 | 直播, 88 元,已上线 |
研究设计 | 连玉君 | 我的特斯拉-实证研究设计,-幻灯片- |
面板模型 | 连玉君 | 动态面板模型,-幻灯片- |
面板模型 | 连玉君 | 直击面板数据模型 [免费公开课,2小时] |
Note: 部分课程的资料,PPT 等可以前往 连享会-直播课 主页查看,下载。
关于我们
课程, 直播, 视频, 客服, 模型设定, 研究设计, stata, plus, 绘图, 编程, 面板, 论文重现, 可视化, RDD, DID, PSM, 合成控制法
等
连享会小程序:扫一扫,看推文,看视频……
扫码加入连享会微信群,提问交流更方便
✏ 连享会学习群-常见问题解答汇总:
✨ https://gitee.com/arlionn/WD
New!
lianxh
命令发布了:
随时搜索连享会推文、Stata 资源,安装命令如下:
. ssc install lianxh
使用详情参见帮助文件 (有惊喜):
. help lianxh