I'm writing a paper concerning changes in in wage-inequality over time in relation to educational homogamy(i.e the tendency to marry someone with the same education as you). To analyze this I'm using the theil-index to do a decomposition/counterfactual analysis of changes in wage-inequality. My problem is that while the main counterfactual Theil-value is correct the counterfactual between/within values are not.
The Theil-index is decomposable into within & between group inequality which is very useful for my purpose as I am primarily interested in the inequality between groups of different educational combinations. To calculate the Theil-value you need three components, p=group distributions, x=mean income and y=within group inequality. My intention is to perform this decomposition on data from 2000 & 2010 and then combine components from both years as to create a counterfactual T-value. This allows me to see what would have happened to wage inequality if only p, distribution of groups, changed between 2000 & 2010. To perform the original decomposition i use the INEQDECO module by SSC.
So far I have managed to produce a counterfactual Theil-value however, I have not been able to produce counterfactual within/between group T-values. the code I use is below.
Code:
ineqdeco wage00, by(educ1) foreach x of numlist 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { local v_`x' = r(v_`x') } ineqdeco wage10, by(educ2) foreach x of numlist 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { local GE_alpha1_`x' = r(ge1_`x') } foreach x of numlist 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { local s_`x' = r(lambda_`x') } foreach num of numlist 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { local my_GE`num' = `v_`num'' * log(`s_`num'') } local my_GEglobal =`my_GE1'+`my_GE2'+`my_GE3'+`my_GE4'+`my_GE5'+`my_GE6'+`my_GE7'+`my_GE8'+`my_GE9'+`my_GE10'+`my_GE11'+`my_GE12'+`my_GE13'+`my_GE14'+`my_GE15' display `my_GEglobal'
In the last "foreach loop" i put in any of the codes posted below as to produce the counterfactual T/between/within values. I know that the first line works because I have tested it using data from only 2000, which produces the same T-value as the standard decomposition.
However, when i try to use the code to produce the counterfactual between-group inequality i always get a negative value, as the Theil-index can't go below 0 i know this to be incorrect. And for within, when i try to apply it on data from only one year i get a different value from when i perform the ordinary decomposition using Ineqdeco. So I know that the counterfactual main-T value is correct but the other two are incorrect and I can not figure out why.
Code:
local my_GE`num' =`s_`num'' * local my_GE`num' = `GE_alpha1_`num'' + `v_`num'' * `s_`num''* log(`s_`num'') // Theil value local my_GE`num' =`GE_alpha1_`num'' + `v_`num'' * log(`s_`num'') // Calculates within-group Theil value local my_GE`num' =`v_`num'' * log(`s_`num'') // Calculates between-group Theil value
0 Response to Problem with a counterfactual analysis of the Theil-index decomposition
Post a Comment