Announcement

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

  • component odds ratios for logistic regression with interaction using lincom

    Hello,

    being new to the derivation of component odds ratios for a logistic regression with an interaction term and the lincom command, I'd be grateful for feedback to make sure that I've understood the idea and that I'm using lincom correctly.

    In a simplified version of my model, I'm evaluating the effect of age (in four categories), sex and the interaction age*sex on risk of postoperative bleeding:

    . label list sex age
    sex:
    0 male
    1 female
    age:
    1 10-19 yrs
    2 20-29 yrs
    3 30-39 yrs
    4 40+ yrs


    Here is the model:

    . logistic rbleed age##sex

    Logistic regression Number of obs = 20,957
    LR chi2(7) = 225.07
    Prob > chi2 = 0.0000
    Log likelihood = -6120.3964 Pseudo R2 = 0.0181


    rbleed Odds Ratio Std. Err. z P>z [95% Conf. Interval]

    age_cat
    20-29 yrs 1.730926 .1701694 5.58 0.000 1.427565 2.098752
    30-39 yrs 1.398721 .1532218 3.06 0.002 1.128462 1.733706
    40+ yrs 1.057445 .1531469 0.39 0.700 .796124 1.404543

    sex
    female .6967148 .0710717 -3.54 0.000 .5704587 .8509144

    age_cat#sex
    20-29 yrs#female .6128676 .0768577 -3.90 0.000 .4793142 .7836336
    30-39 yrs#female .7652589 .1145742 -1.79 0.074 .5706462 1.026242
    40+ yrs#female .7862151 .1587033 -1.19 0.233 .5293221 1.167785

    _cons .103046 .0085828 -27.28 0.000 .0875253 .121319



    Looking at two examples, am I right in assuming that this is the lincom command / component OR for the comparison of females/30-39 yrs old vs. females/10-19 yrs old:

    . lincom 3.age_cat + 1.sex + 3.age_cat#1.sex - (1.age_cat + 1.sex + 1.age_cat#1.sex)

    ( 1) - [rbleed]1b.age_cat + [rbleed]3.age_cat - [rbleed]1b.age_cat#1o.sex + [rbleed]3.age_cat#1.sex = 0

    rbleed Odds Ratio Std. Err. z P>z [95% Conf. Interval]

    (1) 1.070384 .109242 0.67 0.505 .8763287 1.307411


    ...and that this is the component OR for the comparison of females vs. males aged 20-29 yrs?

    . lincom 2.age_cat + 1.sex + 2.age_cat#1.sex - 2.age_cat

    ( 1) [rbleed]1.sex + [rbleed]2.age_cat#1.sex = 0

    rbleed Odds Ratio Std. Err. z P>z [95% Conf. Interval]

    (1) .4269939 .0311467 -11.67 0.000 .3701106 .4926198



    Thanks
    Hanna

  • #2
    am I right in assuming that this is the lincom command / component OR for the comparison of females/30-39 yrs old vs. females/10-19 yrs old:

    . lincom 3.age_cat + 1.sex + 3.age_cat#1.sex - (1.age_cat + 1.sex + 1.age_cat#1.sex)
    Yes, that's correct.

    ...and that this is the component OR for the comparison of females vs. males aged 20-29 yrs?

    . lincom 2.age_cat + 1.sex + 2.age_cat#1.sex - 2.age_cat
    Yes, that is correct. But you can simplify it. Notice that 2.age_cat appears with both a positive and negative sign, so these cancel out. You could just do it as
    Code:
    lincom 1.sex + 2.age_cat#1.sex
    In fact, if you look at your output carefully, you will see that -lincom- itself made this simplification before it did your calculations.

    Comment


    • #3
      Dear Clyde,

      thanks very much, that's really most helpful!

      Best regards
      Hanna

      Comment

      Working...
      X