Announcement

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

  • Interaction terms in Fixed Effects Logit and Conditional Logit models

    Hi Statalist,

    I'm a sociology student looking at the impact of job changes. I'm using panel data from the BHPS to ask "Who benefits from a job change?", I'm answering this question using panel logit models (-xtlogit, fe-) with fixed effects, or conditional logit models grouped by ID (-clogit-). I'm trying to learn more about interactions between time varying covariates (reference category- no change versus a change in employer, or a change in job with the same employer) and non time-varying covariates (gender, or skill). My hunch is that certain workers benefit from an employer change more than others.

    This topic has been mentioned before, lots of people cite Stata tip #87 by Maarten Buis (2010) but the paper seems to focus on logit models for cross sectional data; when I try to run the margins command to see the mobility effect for different genders, I get empty values (not estimable) for the reference category (no change) for both males, and separately for females. Am I doing something wrong? More generally what am I looking at when I see interactions between time invariant and time variant variables in fixed effects logit models? Many have mentioned that they are odds of odds ratios; does that mean that non significant interactions show no differences between time invariant groups (example; males and females) in how time variant covariates affect the dependent variable?
    What are some of the post-estimation commands that communicate clogit interactions effectively?

    Code:
    .   margins, over(female mob2) expression(exp(xb())) post
    
    Predictive margins                                Number of obs   =      44862
    Model VCE    : OIM
    
    Expression   : exp(xb())
    over         : female mob2
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
     female#mob2 |
         male#0  |          .  (not estimable)
         male#1  |   5.299811   8.522933     0.62   0.534    -11.40483    22.00445
       female#0  |          .  (not estimable)
       female#1  |   5.026775   7.968148     0.63   0.528    -10.59051    20.64406
    ------------------------------------------------------------------------------
    
    . 
    end of do-file
    Small Edit: I am using Stata 13


    Any help would be greatly appreciated. Thanks!
    Last edited by Ivan Privalko; 07 Sep 2015, 06:02.

  • #2
    Hello Statalist,

    I've been working through the Buis (2010) example and focusing on the difference between multiplicative and marginal effects. The main difference seems to be that

    1. the clogit does not produce a baseline, the margins command cannot calculate marginal effects without a baseline like the one found in the simple logit command.
    2. Interactions help use discuss only multiplicative effects in clogit.


    I read through some of the clogit discussions in Statalist and saw a few others had similar problems with interaction effects.

    I decided to work through a text book example of a clogit command and add interaction terms myself, to explore the findings.
    Code:
    . use http://www3.nd.edu/~rwilliam/statafiles/teenpovxt, clear
    
    . 
    . /*this data is from Allison's book on fixed effects
    > regression models. the data is from the national
    > longitudinal study of youth (NLSY).
    > the data is made up of 1151 teenage girls 
    > interviewed every year for 5 years from 1979.
    > 
    > the data predicts the likelihood of falling into 
    > poverty*/
    . 
    . xtlogit pov mother spouse school hours ///
    > i.year, fe nolog or
    note: multiple positive outcomes within groups encountered.
    note: 324 groups (1620 obs) dropped because of all positive or
          all negative outcomes.
    
    Conditional fixed-effects logistic regression   Number of obs      =      4135
    Group variable: id                              Number of groups   =       827
    
                                                    Obs per group: min =         5
                                                                   avg =       5.0
                                                                   max =         5
    
                                                    LR chi2(8)         =     97.28
    Log likelihood  = -1520.1139                    Prob > chi2        =    0.0000
    
    ------------------------------------------------------------------------------
             pov |         OR   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mother |   1.790388   .2857157     3.65   0.000     1.309513    2.447848
          spouse |   .4734266   .0830137    -4.26   0.000     .3357355    .6675871
          school |    1.31241   .1479521     2.41   0.016     1.052231    1.636923
           hours |   .9805456   .0030891    -6.24   0.000     .9745098    .9866189
                 |
            year |
              2  |   1.393447   .1415223     3.27   0.001     1.141931    1.700359
              3  |   1.397909   .1513231     3.09   0.002     1.130672    1.728308
              4  |   1.541515   .1796087     3.71   0.000      1.22679    1.936979
              5  |   1.495561   .1907255     3.16   0.002     1.164802    1.920242
    ------------------------------------------------------------------------------
    This is the basic clogit model from Allison's example. I add the dummy variable for black respondents to answer the question "what about interaction effects of non-time varying covariates. are black women as affected by motherhood when compared to non-black women?"

    Code:
    . xtlogit pov mother##black spouse school hours ///
    > i.year, fe or
    note: multiple positive outcomes within groups encountered.
    note: 324 groups (1620 obs) dropped because of all positive or
          all negative outcomes.
    note: 1.black omitted because of no within-group variance.
    
    Iteration 0:   log likelihood = -1525.9022  
    Iteration 1:   log likelihood = -1517.9549  
    Iteration 2:   log likelihood = -1517.9484  
    Iteration 3:   log likelihood = -1517.9484  
    
    Conditional fixed-effects logistic regression   Number of obs      =      4135
    Group variable: id                              Number of groups   =       827
    
                                                    Obs per group: min =         5
                                                                   avg =       5.0
                                                                   max =         5
    
                                                    LR chi2(9)         =    101.61
    Log likelihood  = -1517.9484                    Prob > chi2        =    0.0000
    
    ------------------------------------------------------------------------------
             pov |         OR   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
        1.mother |   2.670141   .6753382     3.88   0.000     1.626471     4.38351
         1.black |          1  (omitted)
                 |
    mother#black |
            1 1  |   .5494145   .1591468    -2.07   0.039     .3114123    .9693138
                 |
          spouse |   .4570411   .0811998    -4.41   0.000     .3226467    .6474157
          school |   1.306194   .1473289     2.37   0.018     1.047125    1.629359
           hours |   .9809708   .0031009    -6.08   0.000     .9749119    .9870675
                 |
            year |
              2  |   1.393609   .1417393     3.26   0.001     1.141742    1.701037
              3  |   1.396889   .1513283     3.09   0.002     1.129664    1.727327
              4  |    1.53728    .179251     3.69   0.000     1.223209    1.931992
              5  |   1.491239   .1903121     3.13   0.002     1.161226    1.915039
    ------------------------------------------------------------------------------
    
    . 
    . margins, over(black mother) ///
    > expression(exp(xb()))
    
    Predictive margins                                Number of obs   =       4135
    Model VCE    : OIM
    
    Expression   : exp(xb())
    over         : black mother
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    black#mother |
            0 0  |          .  (not estimable)
            0 1  |   2.751008    .695338     3.96   0.000     1.388171    4.113846
            1 0  |          .  (not estimable)
            1 1  |   1.741097   .3587588     4.85   0.000     1.037942    2.444251
    ------------------------------------------------------------------------------
    Since there's no baseline, the margins command is not able to calculate the marginal effect of not being a mother, is this because the figure is 1?
    Is the likelihood of falling into poverty compared as follows;

    White women without children:1,
    The same white women after becoming mothers: 2.75

    Black women without children:1,
    The same black women after becoming mothers: 1.74


    Any help would be greatly appreciated,

    Ivan

    Comment


    • #3
      It's the fixed effects. Are you committed to fixed effects rather than random? Economists take a strong line in favour of FE, but here's a paper from Bell & Jones (2015) that argues that the objections are not well founded: https://www.researchgate.net/publica...and_Panel_Data

      Comment


      • #4
        Hi Brendan,

        Thanks for reading my post. I'm reading the attached paper now. Am I committed to fixed effects rather than random? I thought I was, but I am now wondering if it's the best course. I'm using fixed effects to get within-subject estimators of changing employers (example: if a person changes employer, their odds of being satisfied with their pay increases).

        However, I'm also trying to check whether this premium is divided up differently by gender and skill. Do female workers benefit from a job change as much as male workers? In some of the notes and tips authors mention that time-invariant variables can be included through interaction. I just don't know how to interpret the interaction.

        For example, in the Allison case above can it be said that "motherhood has a bigger impact on white respondents, and a smaller impact on black respondents; despite increasing the odds of poverty for both groups"?

        Maybe I'm wrong to consider Fixed Effects Logit here.

        Comment


        • #5
          Hi,

          Just a small note, to whom it may concern; I got some feedback on this problem and the interaction between time-invariant and time-variant variables produces an estimate of how much a time variant variable (like motherhood) over/under estimates an effect through a given time INVARIANT variable (like race). Thinking of Allison's example we normally cannot include time invariant variables (like race), but we can include interactions which tell us how time invariant variables impact the effect of time variant variables (like motherhood). Previously this model predicted the odds of falling into poverty for a group of women;


          Code:
          xtlogit pov mother##black spouse school hours ///
          > i.year, fe or
          note: multiple positive outcomes within groups encountered.
          note: 324 groups (1620 obs) dropped because of all positive or
                all negative outcomes.
          note: 1.black omitted because of no within-group variance.
          
          Iteration 0:   log likelihood = -1525.9022  
          Iteration 1:   log likelihood = -1517.9549  
          Iteration 2:   log likelihood = -1517.9484  
          Iteration 3:   log likelihood = -1517.9484  
          
          Conditional fixed-effects logistic regression   Number of obs      =      4135
          Group variable: id                              Number of groups   =       827
          
                                                          Obs per group: min =         5
                                                                         avg =       5.0
                                                                         max =         5
          
                                                          LR chi2(9)         =    101.61
          Log likelihood  = -1517.9484                    Prob > chi2        =    0.0000
          
          ------------------------------------------------------------------------------
                   pov |         OR   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
              1.mother |   2.670141   .6753382     3.88   0.000     1.626471     4.38351
               1.black |          1  (omitted)
                       |
          mother#black |
                  1 1  |   .5494145   .1591468    -2.07   0.039     .3114123    .9693138
                       |
                spouse |   .4570411   .0811998    -4.41   0.000     .3226467    .6474157
                school |   1.306194   .1473289     2.37   0.018     1.047125    1.629359
                 hours |   .9809708   .0031009    -6.08   0.000     .9749119    .9870675
                       |
                  year |
                    2  |   1.393609   .1417393     3.26   0.001     1.141742    1.701037
                    3  |   1.396889   .1513283     3.09   0.002     1.129664    1.727327
                    4  |    1.53728    .179251     3.69   0.000     1.223209    1.931992
                    5  |   1.491239   .1903121     3.13   0.002     1.161226    1.915039
          ------------------------------------------------------------------------------
          
          .
          end of do-file
          
          . do "C:\Users\ADMINI~1.ADM\AppData\Local\Temp\STD0t000000.tmp"
          
          . display 2.670141*.5494145
          1.4670142

          Here, "motherhood" increases the odds of falling into poverty, "black" is omitted because time-invariant things can't be estimated in fixed effects models (the whole point of this post), but the interaction between "black" and "mother" explains that the negative effect of motherhood is over-estimated for "black mothers", and should be corrected.

          Thus for white respondents, motherhood increases their odds of falling into poverty by 2.67; and for black respondents, motherhood increases their odds of falling into poverty by 1.467 [2.67*0.549=1.467].

          The negative impact of motherhood is less influential on black mothers but more influential on white mothers. Unfortunately this model can't tell us the different odds of falling into poverty between black and white respondents (motherhood aside) who probably differ hugely in their likelihood of falling into poverty; the random effects model explained in Brendan's link is able to express that relationship (and a lot more, it turns out).


          tl;dr interactions between time-invariant and time-variant covariates in fixed effects logit (clogit) models express the over/under estimation of time-variant covariates for specific time invariant groups. Interactions make sense only when discussing within group differences.
          Last edited by Ivan Privalko; 16 Sep 2015, 06:28.

          Comment

          Working...
          X