Announcement

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

  • -xtlogit- with interaction term

    Hi Listers,

    I am analysing data for a study with repeated measures, where participants complete surveys at 5 time points (baseline and then each year for 4 years). My outcome of interest is recovery (yes vs. no) and I am interested in exploring if type of support received (i.e. CBT+exercise vs. exercise vs. usual care) at one time point is associated with recovery at the next follow-up. I specify a model where I regress revovery on support, time, and support*time interaction. My main interest is in the overall main effect of support (averaged across timepoints) and in particular if CBT is superior to usual care and exercise alone.

    I set the code as follows to obtain an ombibus test for support and ideally the main effect for the contrasts: CBT+exercise vs. exercise and CBT+exercise vs. usual care. BUT I am not sure what the coefficients under contrast can be interpreted - are those log(ORs)? Is there a better way to obtain the estimates of the 2 main comparisons?

    Code:
    xtset id 
    xtlogit recovered l1.b2.support i.time , or i(id)
    contrast ar.l1.b2.support, effect


    HTML Code:
        df    chi2    P>chi2
                
    recovered    
    L.support    
    (Exercise vs usual care)    1    2.31    0.1289
    (CBT+exercise vs Exercise)    1    4.38    0.0363
    Joint    2    4.47    0.1072
                
    
                        
        Contrast    Std. err.    z    P>z    [95% conf.    interval]
                        
    recovered    
    L.support    
    (Exercise vs usual care)    .7508156    .4944891    1.52   0.129    -.2183652    1.719996
    (CBT+exercise vs Exercise)    -1.285052    .6137623    -2.09   0.036    -2.488004    -.0820996

    Thank you in advance,
    Laura




  • #2
    The contrasts shown are not odds ratios, they are logarithms of odds ratios. You can get odds ratios by exponentiating them, if you wish.

    The code and results do not quite match your description of what you have done. The contrasts you have estimated do not test CBT+Exercise and Exercise alone vs usual care. They test Exercise vs. usual care, and CBT + Exercise vs Exercise alone. To get the contrasts you said you were interested in, you should chose usual care to be the reference category in your -xtlogit- command.

    You also state that you "...specify a model where I regress revovery on support, time, and support*time interaction." But your -xtlogit- command has no interaction term. Now it may be that the variable support is a three level variable, usual care vs exercise vs exercise + CBT, and, if there was no group that received CBT without exercise, that is a perfectly good way estimating the two contrasts you are interested in. But it is not an interaction model, and it cannot give you an estimate of the effects of CBT alone. As it is not clear to me exactly what your research question is, I can't really say if your model is directed to answer it or not.

    Comment


    • #3
      Hi Clyde,

      Thank you for your help!

      Apologies, I copied the wrong model into the chat - I am also running a simpler model with main effect only as I want to check what (how much) changes when including the interaction.

      I revised the code as you suggested and now I get the correct comparisons with -contrast-; adding eform seems to work and present ORs.

      Code:
      xtlogit recovered l1.i.support##i.time , or i(id)
      contrast r.l1.i.support, effect eform


      HTML Code:
      Margins: asbalanced
      
      -----------------------------------------------------------------
                                    |         df        chi2     P>chi2
      ------------------------------+----------------------------------
      recovered                     |
                          L.support |
          (Exercise vs usual care)  |          1        2.21     0.1371
      (CBT+exercise vs usual care)  |          1        1.24     0.2663
                             Joint  |          2        4.48     0.1064
      -----------------------------------------------------------------
      
      -----------------------------------------------------------------------------------------------
                                    |     exp(b)   Std. err.      z    P>|z|     [95% conf. interval]
      ------------------------------+----------------------------------------------------------------
      recovered                     |
                          L.support |
          (Exercise vs usual care)  |   2.095186    1.04226     1.49   0.137     .7902934    5.554649
      (CBT+exercise vs usual care)  |   .5739851   .2866468    -1.11   0.266     .2156813    1.527526
      -----------------------------------------------------------------------------------------------

      Comment

      Working...
      X