In a repeated cross-sectional designed study I would like to calculate the relative and absolute indexes of inequalities for education and test their associations with the prevalence of hypertension across survey periods. To do so I am using riigen to obtaing relative the index of inequality and then poisson and linear regressions for calculating relative (RII) and absolute (SII) inequalities followed by margins.
Code:
riigen edu, riiname("hyp") varprefix("RII_hyp") glm hypertension c.age i.gender c.RII_hyp_edu##i.survey, fam(poisson) link(log) eform vce(robust) margins, at(survey=(1(1)3)) expression(exp(predict())) saving(RII, replace) vce(uncond) regress hypertension c.age i.gender c.RII_hyp_edu##i.survey, robust margins, at(survey=(1(1)3)) saving(SII, replace) vce(uncond) combomarginsplot RII SII, labels("RII" "SII")
Giovanni
0 Response to Plotting trends in relative and absolute inequalities using riigen and margins
Post a Comment