Hope everyone is keeping safe.
I would like to compute the Gini coefficient for a large number of regions by year.
I would like to generate a new variable and have tried the following loop;
Code:
foreach yr of numlist 1970/1972 { gen gini = . qui ineqdeco income if year==`yr', by(group) replace gini = $S_gini if year==`yr' }
Code:
variable gini already defined
Best,
Chiara
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte group int(year income) 1 1970 1200 1 1970 720 1 1970 2160 2 1970 2400 2 1970 1440 2 1970 4800 3 1970 3480 3 1970 2616 3 1970 0 1 1971 360 1 1971 1200 1 1971 960 2 1971 2760 2 1971 3600 2 1971 0 3 1971 6000 3 1971 960 3 1971 3600 1 1972 600 1 1972 2472 1 1972 600 2 1972 1200 2 1972 4944 2 1972 7944 3 1972 6000 3 1972 2400 3 1972 0 end
0 Response to Gini coefficient by group and year
Post a Comment