Hi,
I need to compute overall theil index, within and between decomposition and inequality for subgroup k, where my subgroup variable is age_class.
I am using ineqdeco and I am able to get the desired results for one country, these are the command I am running:
gen ge1 = . // theil overall index
gen ge1_w = . // within decomposition overall
gen ge1_b = . // btw decomposition overall
gen ge_lev =. // inequality for subgroup k, is calculated as if the subgroup were a separate population
egen subgroup = group( age_class)
keep if country=="AT"
levels subgroup, local(levels)
foreach i in `r(levels)' {
ineqdeco health [w=weight], by (subgroup)
replace ge1 = r(ge1)
replace ge1_w = r(within_ge1)
replace ge1_b = r(between_ge1)
replace ge_lev = r(ge1_`i') if subgroup==`i'
}
My point is that I would like to run the same routine for several countries at the same time but I am not interested in inequality (both within or between) across countries but only across age for each country.
I tried to loop with foreach country but I got the same ge1, ge1_w, ge1_b for all countries meaning that the routine is computing inequality across countries.
Any suggestions would be very much appreciated!
regards
dalila
Related Posts with repeat ineqdeco routine for several countries
svy: how to get mean and standard deviationHey all I am trying to get the mean and the standard deviation from a variable. I know how to do it…
Guidance for estimating multilevel survival models with "mi" (multiple imputation)Dear Statalist members, I am using Stata 15.1 (last updated 15 oct 2018). I am asking for general a…
Combine Graphs with conditionsHi, I created two graphs using the following commands Graph 1 graph hbar (asis) avg? , over(yaxis,…
calculate growth rate of a variable based on a base yearGreetings dear Statalist users, I am currently trying to calculate a growth rate for GDP per capita…
Some questions about lsdvcGood evening, I m a Vietnamese girl. I am really happy to meet you all. I need your help on an issue…
Subscribe to:
Post Comments (Atom)
0 Response to repeat ineqdeco routine for several countries
Post a Comment