Hello everyone,
I have to calculate many gini coefficients for income (here: PrimaryIncome_E) on regional level with Stata 15. My data set consits of 429 regions (here: GeographicRegion_E) with 3000 to 5000 oberservations per region. Additionately it covers a time range from 01.2014 to 06.2017 with quarterly Oberservations so that I have 14 points in time (here: PoolCutoffDate). I want to calculate ginis with a loop for every region at every point in time. So that I have 14*429 = 6.006 ginis in the ende. I used the tool "ineqdec0" from Prof. Jenkins for the calculations and build up the loop with the help of previous posts of the forum.
However, I get the error massage "no observations r(2000)" if I perform the whole loop or that there are "too many values" without the loop. If I run the same code only for the regions, ignoring the time. The calculation of the 429 regions takes some time but in the end it all went well and I get a gini coefficent for each regions.
From my point of view stata seems to be unable to deal with so much data in the memory. Does anyone has an Idea how to deal with this issue?
Thank you very much for answer.
With kind regards,
Peter
I have to calculate many gini coefficients for income (here: PrimaryIncome_E) on regional level with Stata 15. My data set consits of 429 regions (here: GeographicRegion_E) with 3000 to 5000 oberservations per region. Additionately it covers a time range from 01.2014 to 06.2017 with quarterly Oberservations so that I have 14 points in time (here: PoolCutoffDate). I want to calculate ginis with a loop for every region at every point in time. So that I have 14*429 = 6.006 ginis in the ende. I used the tool "ineqdec0" from Prof. Jenkins for the calculations and build up the loop with the help of previous posts of the forum.
However, I get the error massage "no observations r(2000)" if I perform the whole loop or that there are "too many values" without the loop. If I run the same code only for the regions, ignoring the time. The calculation of the 429 regions takes some time but in the end it all went well and I get a gini coefficent for each regions.
From my point of view stata seems to be unable to deal with so much data in the memory. Does anyone has an Idea how to deal with this issue?
Thank you very much for answer.
With kind regards,
Peter
Code:
gen gini = . egen group = group(GeographicRegion_E PoolCutoffDate) su group, meanonly forval i = 1/`r(max)' { ineqdec0 PrimaryIncome_E if group == `i' replace gini = r(gini) if group == `i' }
Comment