全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4229 2
2014-04-14
各位高手,整理论文数据遇上这个难题,我要计算300多个县区(county)收入最高的50%的人口占总收入的比例,但是不懂stata的命令。求大神们指点迷津!!
部分数据如下:

PROVINCECOUNTYincome2
北京1101062.083333
北京1101062
北京1101061.25
北京1101060.833333
北京1101060.583333
北京1101060.583333
北京1101060.5
北京1101060.333333
北京1101060.333333
北京1101060.5
北京1101060.25
北京1101060.5
北京1101060.208333
北京1101060.166667
北京1101060.181818
北京1101140.128571
北京1101140.166667
北京1101140.208333
北京1101140.141667
北京1101140.18
北京1101140.6
北京1101140.454545
北京1101140.416667
北京1101140.25



求各位不吝赐教,初稿deadline在即,江湖救急,胜造七级浮屠!!!
附件列表

求助数据.xlsx

大小:128.24 KB

只需: 1 个论坛币  马上下载

用STATA求分地区的最高收入的50%的人口占总人口收入的比重

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-4-15 02:52:48
may not be the easiest way: try

egen x=count(1), by( county)
gsort county - income2
by county : gen index=_n<round(x/2,1)

the index variable will be 1 for the observations with the highest income2 value within a county cut by 50% of n counts within a county.  There can be ties, so you may need to change the code depending on how to handle the ties.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-4-15 15:09:39
jjjj6666 发表于 2014-4-15 02:52
may not be the easiest way: try

egen x=count(1), by( county)
Thank you very much for your answer!!! It does not give me the direct answer, but it does help a great deal in getting what I want!! Thanks again!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群