Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Odds ratio graph

From   Maarten buis <>
Subject   Re: st: Odds ratio graph
Date   Tue, 14 Sep 2010 07:44:57 +0000 (GMT)

--- On Mon, 13/9/10, Joerg Eulenberger wrote:
> i use xtmelogit to calculate an 3 Level random intercept only model.
> How can i produce an plot like this 
> (
> for the fixed-part of my model?

It is probably easiest when you download the -parmest- and the
-egenmore- packages from SSC. You do that by typing in Stata

ssc install parmest
ssc install egenmore

The former can be used to create a dataset containing your 
estimates. The latter contain the -axis()- program that you
can use to create an axis variable that is sorted by the
estimates. Below is an example of how to combine those (and
for fun I added confidence intervals...)

*------------------ begin example ------------------------
sysuse nlsw88, clear
logit union married never_married collgrad south

parmest, norestore eform
egen axis= axis(estimate), label(parm)

twoway bar  estimate axis, base(1) horizontal barw(.5) ///
            xline(1) ylab(, valuelabel) ||             ///
       rcap min95 max95 axis, horizontal               ///
            legend(order(1 "point estimate"            ///
                         2 "95% conf. int.") pos(6))   ///
            xtitle("odds ratio") ytitle("")
*-------------------- end example -------------------------
(For more on examples I sent to the Statalist see: )

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index