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
How can I calculate the standard deviation with weight??Dear All, I have survey data. It's collected through stratified sampling method. I set a weight whic…
Exporting marginal effect to excel/word document using outreg2 commandHi everyone, I have a long table of marginal effects and their corresponding SEs and CIs. I was wond…
Generating a new variable conditional on multiple values - using 'or' command?Hey, I Hope someone can help me with this: I have a dataset of households in various zip codes. I w…
How to export my Stata result in target?Hi Statalisters, During my coding work, I want to export my result in real time in whatever file fo…
Main directory Mac OSHi, I am currently using Mac OS X stata, and I have some problems setting the main directory. I am…
Subscribe to:
Post Comments (Atom)
0 Response to repeat ineqdeco routine for several countries
Post a Comment