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
Question spmapHi, I have a question about spmap. I'm just a beginner with STATA and I want to know how to use spm…
ivreg, ivprobit and biprobit which one to use? (any theoretical reasoning?)As I do not have any econometric background I find it difficult to understand which one to use when …
BetaregHi all, I have a propotion dependent variable that’s greater than zero and less then one. The mean …
Adding options to a package (.ado)Hi everyone, I have written a code to run the LFK index (Int J Evid Based Healthc. 2018 Dec;16(4):1…
Rename variables to remove part of the textDear Statalists, I have the following variables and would like to rename them to remove untitled###…
Subscribe to:
Post Comments (Atom)
0 Response to repeat ineqdeco routine for several countries
Post a Comment