Announcement

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

  • How to use lincom to get an overall effect of one variable for all values of the other for an interaction term in logistic regression?

    Hello,

    I have a logistic regression model assessing the impact of COVID-19 on odds of death in patients with Bacteraemias. The model has a categorical vs categorical interaction between cases and ethnicity variables. Below is the outcome of my model:

    logistic dead i.cases ib3.age2 i.Sex i.comorbid ib5.IMD ib5.eth ib5.eth#i.cases ib2.onset_encode if comorbid != 5 & IMD != 6 & Sex != 3 & eth != 6
    dead Odds ratio Std. err. z P>z [95% conf. interval]
    cases (ref: pre-pandemic cases)
    Bacteraemia with no COVID (pandemic) 1.128696 .0469193 2.91 0.004 1.040383 1.224506
    Bacteraemia with COVID (pandemic) 2.657374 .1814952 14.31 0.000 2.324431 3.038006
    age_groups (ref: 15 - 44)
    1.650525 .2187061 3.78 0.000 1.27301 2.139992
    1-14 .3749888 .0721286 -5.10 0.000 .2572118 .5466959
    45-64 1.689975 .1054362 8.41 0.000 1.495459 1.909792
    65-74 2.027809 .1264948 11.33 0.000 1.794441 2.291528
    75-84 2.505079 .154768 14.86 0.000 2.219386 2.827549
    85+ 4.059257 .2549682 22.30 0.000 3.589065 4.591048
    Sex
    Male .8806917 .0205493 -5.44 0.000 .8413229 .9219027
    comorbidity (ref: no comorbidity)
    1-2 1.548949 .0575598 11.78 0.000 1.440144 1.665974
    3-4 2.171945 .0855253 19.70 0.000 2.010624 2.34621
    5 or more 3.97011 .1579815 34.65 0.000 3.672239 4.292143
    IMD
    1st (most deprived) 1.106776 .0403061 2.79 0.005 1.030531 1.188662
    2nd 1.032491 .0374681 0.88 0.378 .9616054 1.108602
    3rd .9744415 .0358835 -0.70 0.482 .9065892 1.047372
    4th 1.040487 .0385931 1.07 0.285 .96753 1.118945
    ethnicity (ref: White)
    Asian .7602339 .0443648 -4.70 0.000 .678069 .8523552
    Black .7619127 .0632906 -3.27 0.001 .6474371 .8966292
    Mixed .6901543 .1227129 -2.09 0.037 .4870777 .9778993
    Other 1.401999 .1940003 2.44 0.015 1.068965 1.838789
    eth#cases
    Asian#Bacteraemia with no COVID (pandemic) 1.359244 .1417933 2.94 0.003 1.107904 1.667604
    Asian#Bacteraemia with COVID (pandemic) 2.098096 .3253626 4.78 0.000 1.548193 2.843319
    Black#Bacteraemia with no COVID (pandemic) 1.286516 .1876806 1.73 0.084 .966584 1.712344
    Black#Bacteraemia with COVID (pandemic) 1.350835 .3001279 1.35 0.176 .8739418 2.087958
    Mixed#Bacteraemia with no COVID (pandemic) 1.511664 .4347204 1.44 0.151 .8603374 2.656083
    Mixed#Bacteraemia with COVID (pandemic) 1.246824 .647318 0.42 0.671 .450696 3.449264
    Other#Bacteraemia with no COVID (pandemic) .6595776 .1689423 -1.62 0.104 .3992469 1.089658
    Other#Bacteraemia with COVID (pandemic) .8575516 .2796592 -0.47 0.637 .4525556 1.624982
    onset_encode (ref: Community onset)
    COHA 1.383543 .0401135 11.20 0.000 1.307114 1.464441
    Hospital_Onset 1.871458 .0510639 22.97 0.000 1.774004 1.974266
    _cons .5396891 .2860624 -1.16 0.245 .1909695 1.525188

    Since I am going to write these results as a table in a paper, I am struggling with certain aspects of the lincom command to decipher the interaction term.

    Ideally, I want to get two types of information to present in the paper. The first one is to get the comparison of each ethnic group to its baseline (white) within each case category. This is how I get it via lincom for Asians (1.eth) in Bacteraemia with COVID category (3.cases) of cases variable :


    lincom 1.eth + 1.eth#3.cases
    dead Odds ratio Std. err. z P>z [95% conf. interval]
    (1) 1.595044 .229646 3.24 0.001 1.202877 2.115067

    The second bit of information I want is the overall odds ratios of 2.cases (Bacteraemia with no COVID) and 3.cases (Bacteraemia with COVID) when compared to baseline of pre-pandemic cases (1.cases). This is where I am struggling. As I understand the interactions, the model output for cases in the table above is for the reference category (Whites) of ethnicity. Now using lincom, I can get the odds ratios for cases within each ethnic group (example for Asians: lincom 3.cases + 3.cases#1.eth).


    However, this is not what I ideally want to present. So the question is, is there a way to calculate the overall odds ratios for 2.cases and 3.cases from the model irrespective of the ethnic group category? I have tried this command for 3.cases:

    lincom 3.cases + 3.cases#1.eth + 3.cases#2.eth + 3.cases#3.eth + 3.cases#4.eth
    dead Odds ratio Std. err. z P>z [95% conf. interval]
    (1) 8.052774 5.521473 3.04 0.002 2.100438 30.87317

    I am pretty sure that this is not the right output. Would be very thankful is someone could please let me know if it is possible to get what I am looking for here?

    Many thanks,
    Taimoor
Working...
X