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, statalist.org is already up and running.

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

 From Maarten Buis To statalist@hsphsun2.harvard.edu 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:
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

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

http://www.maartenbuis.nl
--------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```