楼主: sparklem65
7156 14

GINI系数的SAS编程计算 [推广有奖]

11
vv5000 发表于 2010-10-10 10:15:50
要下载..........................................

12
woodycn 发表于 2010-11-27 14:13:33
楼主的程序偏长。
我照着楼主的公式编写了类似的程序,不知道有没有问题:

options nodate nonotes nosource;

data Raw;
input Population Resource;
cards;
1000 20
2000 40
3000 60
;

proc sql;
    create table aa as select Population/sum(Population) as w,Resource/sum(Resource) as y,1/n(Population) as Inverse_n  from Raw order by y,w;
quit;

data aa;
set aa;
v+y;                                                             *v is the cumulated percentage;
g=w*y+2*w*(1-v)-Inverse_n;                 *g is the left part of Gini=... equation, ;
run;

proc means data=aa noprint;var g;output out=temp sum=Gini;

data _null_;set temp;put Gini=;run;

13
friend123 发表于 2013-1-29 00:25:55
能麻烦一下LZ传一下数据库吗?xin.viking@gmail.com,感激不尽~~

14
王建润 发表于 2013-1-30 21:13:07
好像没有数据库  。楼主能传一下数据库不?  

15
olive_long 发表于 2014-4-24 21:43:41
说好的数据库呢?

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-19 19:19