Hello members,
I am doing a decomposition of the concentration index in stata to determine the % contribution of my predictor variables to the existing inequalities in health insurance coverage. I have been able to calculate elasticities, concentration indices and contribution of all of my predictor variables but I can't do the same for the residuals.
I undestand that the sum of the % contributions (for the predictor variables+ the residuals) should be 100%, and the concentration index of the residuals=overall concentration index - sum of concentration indices of the predictor variables.
Using the above formula (if it is true) I can get the above estimates. But is there a command in stata that one can run to get all the three estimates without using the addition and subtraction as above?
Below is my code for the whole decomposition.
conindex insured [aw=weight], rank(v191) bounded limits(0 1) wagstaff
sca CI = r(CI)
global X ragecat employment gender hheadsex residence maritalstatus ///
media hholdsize education ses
qui glm insured $X [aw=weight], family(binomial) link(logit)
qui margins , dydx(*) post
mat coeff = e(b)
sum insured [aw=weight]
sca m_y=r(mean)
foreach x of varlist $X {
qui{
mat b_`x' = coeff[1,"`x'"]
sca b_`x' = b_`x'[1,1]
qui sum `x'
gen double scaled_`x' = `x'/r(max)
conindex scaled_`x' [aw=weight], rank(v191) bounded limits(0 1) wagstaff
sca CI_`x' = r(CI)
sum `x' [aw=weight]
sca elas_`x' = (b_`x' * r(mean))/m_y
sca con_`x' = elas_`x' * CI_`x'
sca prcnt_`x' = con_`x'/CI
}
di "`x' elasticity:", elas_`x'
di "`x' concentration index:", CI_`x'
di "`x' contribution:", con_`x'
di "`x' percentage contribution:", prcnt_`x'
}
I am doing a decomposition of the concentration index in stata to determine the % contribution of my predictor variables to the existing inequalities in health insurance coverage. I have been able to calculate elasticities, concentration indices and contribution of all of my predictor variables but I can't do the same for the residuals.
I undestand that the sum of the % contributions (for the predictor variables+ the residuals) should be 100%, and the concentration index of the residuals=overall concentration index - sum of concentration indices of the predictor variables.
Using the above formula (if it is true) I can get the above estimates. But is there a command in stata that one can run to get all the three estimates without using the addition and subtraction as above?
Below is my code for the whole decomposition.
conindex insured [aw=weight], rank(v191) bounded limits(0 1) wagstaff
sca CI = r(CI)
global X ragecat employment gender hheadsex residence maritalstatus ///
media hholdsize education ses
qui glm insured $X [aw=weight], family(binomial) link(logit)
qui margins , dydx(*) post
mat coeff = e(b)
sum insured [aw=weight]
sca m_y=r(mean)
foreach x of varlist $X {
qui{
mat b_`x' = coeff[1,"`x'"]
sca b_`x' = b_`x'[1,1]
qui sum `x'
gen double scaled_`x' = `x'/r(max)
conindex scaled_`x' [aw=weight], rank(v191) bounded limits(0 1) wagstaff
sca CI_`x' = r(CI)
sum `x' [aw=weight]
sca elas_`x' = (b_`x' * r(mean))/m_y
sca con_`x' = elas_`x' * CI_`x'
sca prcnt_`x' = con_`x'/CI
}
di "`x' elasticity:", elas_`x'
di "`x' concentration index:", CI_`x'
di "`x' contribution:", con_`x'
di "`x' percentage contribution:", prcnt_`x'
}
Comment