Friday, November 27, 2015

Coefplot in Stata to represent coefficients of a model

Sometimes you need to display coefficients, effect sizes you get from a model in a graphics. Odds ratios, Relative risks or IRRs are of that kind.
Stata has some commands to do this according to this file  :marginsplot and coefpilot are two examples. The document I referred explains them with a special emphasis to coefpilot.
After you fit a model, you can use a syntax like
coefplot, coeflabels(var1="label1" var2="label2) eform drop(_cons) xline(1) xtitle(Odds Ratios and Confidence Intervals)
you can represent odds ratios and their confidence intervals obtained from a logistic regression model.
Here eform option make Odds ratios displayed, otherwise plain coefficients are seen.