楼主: happy_287422301
4743 7

五百币菜鸟寻帮助 [推广有奖]

区版主

大师

30%

还不是VIP/贵宾

-

威望
8
论坛币
637710 个
通用积分
28431.0754
学术水平
2339 点
热心指数
2999 点
信用等级
2126 点
经验
206128 点
帖子
8560
精华
10
在线时间
4670 小时
注册时间
2008-3-19
最后登录
2024-5-6

三级伯乐勋章 初级学术勋章 初级热心勋章 初级信用勋章 中级学术勋章 中级热心勋章 高级学术勋章 中级信用勋章 高级信用勋章 高级热心勋章 特级学术勋章 特级信用勋章 特级热心勋章

500论坛币
我是一个stata的初学者,现在遇到一个问题,就想马上知道咋操作,以后慢慢学习stata的操作技巧,无奈悬赏,细节如下:

这是一个关于用stata中inequal计算泰尔指数与基尼系数的小工具,我不会使用,还请高手指点,能让我使用相关数据得到结果就行


在stata中运行help  ainequal,出现以下的提示信息:
help for ainequal
Joao Pedro Azevedo

-------------------------------------------------------------------------------

Measures of inequality (revised)


ainequal varlist [weight] [if exp] [in range] [, format(%fmt) ATKinson


EPSilon(#[ #[ ...]]) RELSGini Delta(#[ #[ ...]]) shorrocks


alpha(#[ #[ ...]]) nogini notheil rmd cov sdl mehran piesch


kakwani mld ge_1 ge2 all benchmark]


aweights and fweights are allowed; see help weights.


Description

ainequal computes a series of inequality measures of the variables in varlist.
It is a revised and upgraded version of inequal7 and inequal published by
Edward Whitehouse in STB-23.

The inequality measures computed are: the "relative mean deviation", the
"coefficient of variation", the "standard deviation of logs", the"Gini index",
the "Mehran index", the "Piesch index", the "Kakwani index", "Theil entropy
index", the "mean log deviation", the "generalised entropy measure" for all
sensitivity [see, e.g., Cowell [1995] and Amiel and Cowell [1999] for a
definition of these measures], the "Atkinson Inequality Index" using the
inequality aversion parameter epslon, and the "Donaldson-Weymark relative
S-Gini" using the distributional sensitivity paramether delta.

In addition ainequal also computes the relative poverty line proposed by
Hoffmann [2001] and Lambert and Lanza [2006], for the Gini, Theil-T and
Theil-L.

Up to 5 variables can be specified in varlist.

Option

format(%fmt) specifies the format to be used to display the estimated

inequality indices. The default is to use a %6.5f format.



delta() specifies the distributional sensitivity parameters used in computing

the relative S-Gini.


epsilon() specifies the inequality aversion parameters used in computing

Atkinson inequality index.


alpha() specifies the sensitivity alpha used on the generalised entropy

measure.


all requests that all possible measures are computed and reported.
By default,


no measure is produced. The Gini and Theil are the deafult measures
.


benchmark calculates the Relative Poverty Line (Hoffmann, 2001) or Benchmark

Income Level (Lambert and Lanza, 2006) for the Gini, Theil-L and Theil-T.


The following options specify the measures to be computed and reported.


rmd contain the "relative mean deviation"


cov contain the "coefficient of variation"


sdl contain the "standard deviation of logs"


mehran contain the "Mehran index"


piesch contain the "Piesch index"


kakwani contain the "Kakwani index"


mld contain the "Mean Log Deviation (or generalised entropy measure with


sensitivity parameter 0)"


ge_1 contain the "Generalised entropy measure with sensitivity parameter


-1"


ge2 contain the "Generalised entropy measure with sensitivity parameter 2"


Saved Results


ainequal returns results in r() format.
[Important notice: When multiple

variables are entered in varlist, returned results are for all inequality
measures of the variable listed.]

Author


Joao Pedro Azevedo


jazevedo@ipea.gov.br


IPEA



This is a modified version of the ado inequal7 written by Philippe Van

Kerm.

Reference


Amiel, Y. and Cowell, F.A. (1999) Thinking about Inequality. Cambridge


University Press. United Kingdom.



Coulter Ph. (1989), Measuring Inequality -A Methodological Handbook-,


Westview Press USA.



Cowell, F.A. (1995). Measuring Inequality (second edition).


Prentice-Hall/Harvester-Wheatsheaf, Hemel Hempstead.



Hoffmann, R. (2001) Effect of the rise of a person's income on inequality.


Brazlian Review of Econometrics v.21, no.2, pp.237-262.



Lambert, P.J. and Lanza, G. (2006) The effect on inequalities of changing


one or two incomes.
The Journal of Economic Inequality. 4:253-277.


Also see


Manual:
[R] lorenz


STB:
sg30 (STB-23)

On-line:
help for inequal (if installed), inequal7 (if installed), ineqdeco

最佳答案

h3327156 查看完整内容

您既然help ainequal会得到那些叙述ainequal的字眼【代表您已经灌好这个指令了】 您说您要得到基尼系数和泰尔指数, 很简单,因为如果您不指定stata要其他的不均测度【指基尼系数和泰尔指数以外的方法】 则stata默认值default就是基尼系数和泰尔指数 您在stata的comand下贴入红色的部份【超简单的例子】; sysuse auto ainequal price 第一行是叫资料,我不知道您的资料【叫资料输入资料应该没问题吧!】 第二行指令ain ...
关键词:distribution inequalities econometrics Sensitivity Generalised 菜鸟 菜鸟
沙发
h3327156 发表于 2010-11-20 09:45:12 |只看作者 |坛友微信交流群
您既然help  ainequal会得到那些叙述ainequal的字眼【代表您已经灌好这个指令了】
您说您要得到基尼系数和泰尔指数,
很简单,因为如果您不指定stata要其他的不均测度【指基尼系数和泰尔指数以外的方法】
则stata默认值default就是基尼系数和泰尔指数

您在stata的comand下贴入红色的部份【超简单的例子】;
sysuse auto
ainequal price

第一行是叫资料,我不知道您的资料【叫资料输入资料应该没问题吧!】
第二行指令ainequal给敲进去,加上您想计算哪个变量,这个例子是变量price,当然您可能有您想计算的
您输入完之后后,会看到以下的东西
---------------------------------------
       Inequality measures |      price
---------------------------+-----------
          Gini coefficient |    0.23222
Theil index (GE(a), a = 1) |    0.09557
---------------------------------------
这不就是您想要的吗?

当然变量可以一次输入多个【以下是两个变量的例子,变量个数好像有上限】
sysuse auto,clear
ainequal price weight

到时您就可以看到

---------------------------------------------------
       Inequality measures |      price      weight
---------------------------+-----------------------
          Gini coefficient |    0.23222     0.14605
Theil index (GE(a), a = 1) |    0.09557     0.03300
---------------------------------------------------

好!接下来,您可能想学更多,那就得加上一些选项操作【即逗后  , 后面一堆的设定】
坦白说那些我也不懂,说定您会更懂,毕竟这是您研究的课题。
简言之,如果想要基尼系数和泰尔指数以外的方法就必须要加上这些选项设定,
此外,如果要控制和调整基尼系数和泰尔指数这些计算内部细微的设定什么的,也是用这些选项设定。
【这些调控,可能要留待您这些行家们去解决啰!】

希望以上这些东西对您有帮助~
已有 1 人评分经验 学术水平 热心指数 信用等级 收起 理由
happy_287422301 + 100 + 5 + 5 + 2 你太棒啦,刚才有一位网友也是这么说的,而且可以做,你能对这两个指数进行分解吗?

总评分: 经验 + 100  学术水平 + 5  热心指数 + 5  信用等级 + 2   查看全部评分

使用道具

藤椅
happy_287422301 在职认证  发表于 2010-11-20 09:46:57 |只看作者 |坛友微信交流群

对熟悉stata的人来说应该不是很难,

我需要的指导是怎么样进行操作

能得到想要的

基尼系数和泰尔指数。

使用道具

板凳
蓝色 发表于 2010-11-20 16:18:49 |只看作者 |坛友微信交流群
happy_287422301 发表于 2010-11-20 09:46

对熟悉stata的人来说应该不是很难,

我需要的指导是怎么样进行操作

能得到想要的

基尼系数和泰尔指数。

h3327156   解释的还不明白吗。
已有 1 人评分热心指数 收起 理由
happy_287422301 + 2 如何加权呢?

总评分: 热心指数 + 2   查看全部评分

使用道具

报纸
happy_287422301 在职认证  发表于 2010-11-20 22:03:39 |只看作者 |坛友微信交流群
蓝色 发表于 2010-11-20 16:18
happy_287422301 发表于 2010-11-20 09:46

对熟悉stata的人来说应该不是很难,

我需要的指导是怎么样进行操作

能得到想要的

基尼系数和泰尔指数。

h3327156   解释的还不明白吗。
他解释的挺好,我试了一下,果然能有预期效果,但是这样的话好像是将每一组的权重等同处理,应该以各组人口加权吧?

使用道具

地板
h3327156 发表于 2010-11-21 01:09:39 |只看作者 |坛友微信交流群
哈!
谢谢!
互相讨论与交流
阿! 我不懂那个~"基尼系数和泰尔指数都是可以分解的,你会吗?"
我不会,真的不会!
~~以上是回应您传的消息,我就不在那边回您了!请见谅~~~

您帖子上问,如果加权,加权的指令。
您看help ainequal后,
[weight”
那个就是设定加权的

我用一个例子,您比较一下变化,计算出来还是有不同的。
sysuse auto
ainequal price
ainequal price [fweight=trunk]

第三行的fweight是加权方法的一种,trunk则是要用以加权的变数
【您自己设定您想加权的变数】
已有 1 人评分经验 热心指数 收起 理由
happy_287422301 + 100 + 2 补偿

总评分: 经验 + 100  热心指数 + 2   查看全部评分

使用道具

7
YOlanDA凡凡 发表于 2016-4-20 15:54:28 |只看作者 |坛友微信交流群
可以用ineqdeco命令这个一运行就可以得出

使用道具

8
lunwenz0 发表于 2017-3-29 11:33:01 |只看作者 |坛友微信交流群
请问计算泰尔指数分解,怎么输入数据和设置group啊

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-12 02:51