Hello,

I have a few questions regarding -lincom- command; my question is that whether the associations of mpg with foreign differ by rep78 (between group 4 and 5). I'm trying to get the odds ratio for rep78_5_foreign:mpg relative to rep78_4_foreign:mpg

1. After using the interaction terms below, how can I use lincom command to get the odds ratio for rep78_5_foreign:mpg relative to rep78_4_foreign:mpg?
  • CODE:
    • sysuse auto, clear
    • logistic foreign i.rep78##(c.mpg c.headroom) if inlist(rep78, 4, 5)
    • margins rep78, dydx(mpg headroom) predict(xb)
Expression : Linear prediction (log odds), predict(xb)
dy/dx w.r.t. : mpg headroom

------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg |
rep78 |
4 | .3371559 .21614 1.56 0.119 -.0864707 .7607825
5 | -.1280908 .1402961 -0.91 0.361 -.4030661 .1468845
-------------+----------------------------------------------------------------
headroom |
rep78|
4 | -.9515521 1.069587 -0.89 0.374 -3.047904 1.1448
5 | 3.009371 2.605404 1.16 0.248 -2.097127 8.115869


2. In general, when do you use lincom a - b and lincom a + b?

Thank you very much for your help.