I have conceptual and Stata-oriented questions about generating (and later plotting) Gini coefficients alongside 95% confidence intervals. Part 1 is conceptual/statistical, part 2 is more narrowly about Stata syntax.
Part 1:
The tricky part here is that the units between which I want to estimate income inequality are not individuals but aggregates of individuals - regions. I want to know whether inequality between places has risen or fallen over time
Starting from person-level survey microdata, I generate mean incomes for each location, taking into account survey weights. Then I calculate a series of Gini coefficients that track the nature of inter-place income inequality over time. I weight these Ginis by population, as locations differ massively in terms of population.
Initially I was running commands like
Code:
g gini=. ineqdeco hw [fw=pop], by(year) foreach z in 1940 1950 1960 1970 1980 1990 2000 2010 2019 { replace gini=r(gini_`z') if year==`z' }
Part 2:
The less conceptual part is the following. If I can get the right svyset command as far as weights go, how to get svylorenz to place the lower and upper ends of the Gini CI in their own variables?
If I could put the upper and lower bounds in their own variables, as I did with the gini (call the new variables uci and lci), I could then do something like:
Code:
tw (rarea uci lci year , astyle(ci)) /// (connected gini year, mstyle(p1)) /// ... etc...
Thanks in advance.
Tom
0 Response to Gini coefficients with confidence intervals
Post a Comment