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

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

 From Ricardo Ovaldia <[email protected]> To [email protected] Subject Re: st: main effect OR when interaction present - xtlogit- Date Tue, 16 Aug 2011 06:54:20 -0700 (PDT)

```Excellent. Thank you very much.

Ricardo

Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK

--- On Tue, 8/16/11, Maarten Buis <[email protected]> wrote:

> From: Maarten Buis <[email protected]>
> Subject: Re: st: main effect OR when interaction present - xtlogit-
> To: [email protected]
> Date: Tuesday, August 16, 2011, 6:56 AM
> 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
> 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/
>

*
*   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/
```