$X has list of categorical variables which has more than 2 categories.
When I run the code it says that "The variable (age) takes values outside of the specified limits". age has 5 categories here.
**measuring inequality through erreygers concentration index
conindex rh_prob_minone, rank(wi) erreygers bounded limits(0 1) cluster(cluster_line)
sca CI = r(CI)
global X age rc_litr_cats husb_lit hhld_head_sex wealth_index_sco wealth_index use_tobacco we_earn_wm_decide we_earn_hs_decide
qui sum rh_prob_minone
sca m_y=r(mean)
qui glm rh_prob_minone $X , family(binomial) link(probit)
qui margins , dydx(*) post
foreach x of varlist $X {
sca b_`x'=_b[`x']
}
foreach x of varlist $X {
qui{
conindex `x', rank(wi) erreygers bounded limits(0 1) cluster(cluster_line) compare(year)
sca CI_`x' = r(CI)
sum `x'
sca elas_`x' = 4*(b_`x' * r(mean))
sca contri_`x' = elas_`x' * CI_`x'
sca prcnt_`x' = (contri_`x'/CI)*100
}
di "`x' elasticity:", elas_`x'
di "`x' concentration index:", CI_`x'
di "`x' contribution:", contri_`x'
di "`x' percentage contribution:", prcnt_`x'
}
When I run the code it says that "The variable (age) takes values outside of the specified limits". age has 5 categories here.
**measuring inequality through erreygers concentration index
conindex rh_prob_minone, rank(wi) erreygers bounded limits(0 1) cluster(cluster_line)
sca CI = r(CI)
global X age rc_litr_cats husb_lit hhld_head_sex wealth_index_sco wealth_index use_tobacco we_earn_wm_decide we_earn_hs_decide
qui sum rh_prob_minone
sca m_y=r(mean)
qui glm rh_prob_minone $X , family(binomial) link(probit)
qui margins , dydx(*) post
foreach x of varlist $X {
sca b_`x'=_b[`x']
}
foreach x of varlist $X {
qui{
conindex `x', rank(wi) erreygers bounded limits(0 1) cluster(cluster_line) compare(year)
sca CI_`x' = r(CI)
sum `x'
sca elas_`x' = 4*(b_`x' * r(mean))
sca contri_`x' = elas_`x' * CI_`x'
sca prcnt_`x' = (contri_`x'/CI)*100
}
di "`x' elasticity:", elas_`x'
di "`x' concentration index:", CI_`x'
di "`x' contribution:", contri_`x'
di "`x' percentage contribution:", prcnt_`x'
}