Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • calculation odd ratio for interaction terms using Lincom

    I am doing logistic regression to look at several predictors for a certain outcome. I checked the interaction between two of these predictors using LRT and found an interaction.
    I want to use Lincom command to combine the coefficents and produce OR that I can report in my result table. My problem is that I do not rely understand how to do this.

    code for final model:

    logistic persis90_180 b5.region##i.lap age i.gender if exposure==0

    *I have 10 region that interact with 3 lap

    I ran a loop to get Or for lap and region and another loop for region and lap
    forvalues l = 0/2 {
    forvalues r = 0/10{
    di "reporting OR for lap `l' and r `r'"
    lincom `l'.lap + `l'.lap#`r'.region
    }
    }
    Ex: result
    reporting OR for lap 1 and r 1

    reporting OR for lap 1 and r 1

    ( 1) [persis90_180]1.lap + [persis90_180]1.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .5768613 .1228305 -2.58 0.010 .3800371 .8756224
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 2

    ( 1) [persis90_180]1.lap + [persis90_180]2.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .6587111 .0740223 -3.71 0.000 .5284959 .8210097
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 3

    ( 1) [persis90_180]1.lap + [persis90_180]3.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .6154713 .1528265 -1.95 0.051 .3783098 1.001309
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 4

    ( 1) [persis90_180]1.lap + [persis90_180]4.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .2883573 .1106711 -3.24 0.001 .1359068 .611816
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 5

    ( 1) [persis90_180]1.lap + [persis90_180]5b.region#1o.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .4773321 .0614427 -5.75 0.000 .3708967 .6143109
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 6

    ( 1) [persis90_180]1.lap + [persis90_180]6.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .9382366 .2107756 -0.28 0.777 .6040728 1.457255
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 7

    ( 1) [persis90_180]1.lap + [persis90_180]7.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .5652742 .0770354 -4.19 0.000 .4327706 .7383472
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 8

    ( 1) [persis90_180]1.lap + [persis90_180]8.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .6218397 .0902302 -3.27 0.001 .4679154 .8263986
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 9

    ( 1) [persis90_180]1.lap + [persis90_180]9.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .6056324 .0850629 -3.57 0.000 .4598914 .7975591
    ------------------------------------------------------------------------------
    reporting OR for lap 1 and r 10

    ( 1) [persis90_180]1.lap + [persis90_180]10.region#1.lap = 0

    ------------------------------------------------------------------------------
    persis90_180 | Odds ratio Std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    (1) | .6244288 .104551 -2.81 0.005 .4497408 .866969
    ------------------------------------------------------------------------------



    my question is how to get the final OR for lap 1 if i have 10 regions tested, and got other results for each region ? Is there ant resuorces that can help me to understand this process? How to report interaction results in final table




  • #2
    my question is how to get the final OR for lap 1 if i have 10 regions tested, and got other results for each region
    I don't understand what you mean. The output you show gives the full information about the effects, in odds ratio metric, of each level of lap on persis90_180 in each of the 10 regions. What are you looking for? There is nothing more to say about the interaction.

    Comment

    Working...
    X