Announcement

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

  • Interpreting odds ratios, main effects and interaction effects

    Dear Statalist users,

    I'm trying to interpret odds ratios for a model I am using and I am having some difficulty getting my head around it despite having read many discussions about it online. I looking at a simple outcome variable 0 = not in full-time employment; 1 = in full-time employment. I am looking the relationship between sex (0 = Men, 1 = women) and time (0 = 2001/2008, 1= 2009/2016) on the outcome. I have modelled both the main effect plus the interaction term and also just the interaction effects. Do I necessarily need to include both the main effect and interaction effect or could I just model the interaction terms. Modelling the interaction terms seems much more straight forward (see Example 1) in terms of interpreting the effect because it seems as if I make the interpretation of each term in relation to sex at 0 and time at 0 (e.g. men at time 0). So here, men at time one are 15 percent less likely to be in full-time employment at time 1 than time 0. Including the main effects plus interaction effects (see Example 2) makes it harder or more difficult to interpret. If I understand correctly 1.sexr in this model is women at time 0, 1.time is men at time 1 and the interaction term is women at time 1. Is this correct? And when interpreting the interaction term in this example, am I say that women at time 1 are 11 percent more likely to be employed than men at time 0? Or is that not correct? I would prefer just to use the interaction effects only model because of its ease but is this okay?

    Your guidance would be greatly appreciated as always..

    Best
    Brendan

    --

    Example 1. Interaction terms only

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

    sexr#time
    0 1 .852401 .0270936 -5.02 0.000 .8009188 .9071925
    1 0 .3115613 .0118856 -30.57 0.000 .2891155 .3357497
    1 1 .295497 .0108253 -33.28 0.000 .2750237 .3174944

    _cons 2.173427 .0610827 27.62 0.000 2.056945 2.296505


    Example 2. Main + interaction

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

    1.sexr .3115613 .0118856 -30.57 0.000 .2891155 .3357497
    1.time .852401 .0270936 -5.02 0.000 .8009188 .9071925

    sexr#time
    1 1 1.112668 .0482501 2.46 0.014 1.022007 1.211372

    _cons 2.173427 .0610827 27.62 0.000 2.056945 2.296505
    Last edited by Brendan Churchill; 13 Jun 2018, 00:36.

  • #2
    I wasn't being very clear beforehand - I'll restate my questions / problem

    My data:

    Code:
    * Example generated    by -dataex-. To install:    ssc    install    dataex
    clear
    input byte activit1    float(sexr time)
    0 1 0
    0 1 0
    0 1 0
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    1 1 1
    1 1 0
    0 1 1
    0 1 1
    1 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 0
    0 1 0
    0 1 0
    0 1 0
    0 0 0
    1 0 0
    1 0 0
    1 0 0
    1 0 0
    1 0 0
    1 0 0
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 0
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 0
    0 1 0
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 1 1
    0 0 1
    0 0 1
    0 0 1
    0 0 1
    1 0 0
    0 0 0
    1 0 0
    1 0 0
    1 0 0
    0 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    0 0 1
    0 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    1 0 1
    end

    When I use the following code:


    Code:
    xtlogit activit1 sexr#time
    And I get the following results:

    Code:
    sexr#time    
    0 1    -.1596982    .031785    -5.02    0.000    -.2219957    -.0974006
    1 0    -1.166159    .0381486    -30.57    0.000    -1.240929    -1.091389
    1 1    -1.219097    .0366341    -33.28    0.000    -1.290898    -1.147295
        
    _cons    .7763051    .0281043    27.62    0.000    .7212217    .8313886
    I get the following odds ratios

    Code:
    0 1     0.852
    1 0     0.312
    1 1     0.295
    How do interpret these? iCan I say men in time 1 ( 0 1) were 15 percent less less likely to be in full-time employment, women in time 0 (1 0) were 69 percent less likely and women in time 1 (1 1) were 70.5 less less likely? Am I able to say in reference to men in time 0? Or do these stand alone? Do I need to include main effects?
    Last edited by Brendan Churchill; 13 Jun 2018, 06:49.

    Comment


    • #3
      If you're having trouble interpreting odds ratios, you may find it easier to work with predicted values using the margins statement rather than odds ratios. Almost any time you have an interaction, you should include the main effect.

      Comment


      • #4
        How do interpret these? iCan I say men in time 1 ( 0 1) were 15 percent less less likely to be in full-time employment, women in time 0 (1 0) were 69 percent less likely and women in time 1 (1 1) were 70.5 less less likely? Am I able to say in reference to men in time 0?
        Please, never ever say less likely or make any statement referencing probability in the context of a logistic model (unless you're talking in about a rare event and you issue the caveat that the odds ratio approaches the relative risk in those cases). The margins command is really beneficial in this case, and you should read the manual - and also be aware that the change in the probability of the outcome is going to vary depending on the group's covariates (this is a non-linear model).

        In your case, you could type

        Code:
        margins sexr#time
        and you would get (I believe) the average predicted probability of the outcome among sex and time groups, accounting for the interaction term. If you omit the interaction operator (#), you get the average predicted probability by sex and by time separately. If you add the option -atmeans-, you will fix all covariates to the sample mean.
        Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

        When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

        Comment


        • #5
          Hi Weiwen,

          Maybe I am mistaken, but I don't think its possible to predict probabilities of an interaction term, nor calculating marginal effects of an interaction term, or am I thinking wrongly?

          Comment


          • #6
            Originally posted by Carsten Preuss View Post
            Hi Weiwen,

            Maybe I am mistaken, but I don't think its possible to predict probabilities of an interaction term, nor calculating marginal effects of an interaction term, or am I thinking wrongly?
            You are absolutely right, margins doesn't predict the probability of the interaction term by itself. However, margins will incorporate interaction terms in its calculations. This code should show what I meant.it
            Code:
            webuse margex
            quietly logistic outcome i.sex i.group
            margins sex#group
            quietly logistic outcome i.sex##i.group
            margins sex#group
            Last edited by Weiwen Ng; 15 Jun 2018, 08:29.
            Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

            When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

            Comment

            Working...
            X