Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: main effect OR when interaction present - xtlogit-

From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: main effect OR when interaction present - xtlogit-
Date   Tue, 16 Aug 2011 13:56:17 +0200

On Tue, Aug 16, 2011 at 12:56 PM, Ricardo Ovaldia wrote:
> So I gather that the best way to show these results is to estimate the OR and 95%CI for specific points in time.

That is the whole point of adding an interaction effect with time. By
adding that interaction effect you are saying that you want the effect
of group to change over time. If something changes you cannot
represent it with one number.

>Is there a way to do this easily in Stata?

I guess that in Stata 12 that would be easy with the new -contrast-
and -marginsplot- commands in Stata 12, but as I do not have access to
that yet I cannot say more.

In Stata 11 you can predict those and their confidence interval using
-predictnl-. After that you create graphs or tables, like:

*------------------ begin example ---------------------
webuse union, clear
gen cyear = (year - 70)/10
xtlogit union age grade i.not_smsa south##c.cyear, or

// compute the odds ratios for each year
predictnl or = exp(_b[1.south] + _b[1.south#c.cyear]*cyear) ///
		  , ci(lb ub)
// you can graph it		
bys year : gen byte mark = _n == 1
twoway rarea lb ub year if mark || ///
       line or year if mark,       ///
       legend(off) ytitle(odds ratio)

// or display it in a table
// (or lb ub are constant within year)
table year, c(mean or mean lb mean ub)
*------------------------ 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index