Announcement

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

  • Fixed effects, logit

    Hello,

    Im having trouble adding fixed effects to a logit (industry, year). I added the 'fixed effects' as i.industry, i.year (and clustering on firm level)
    No i am wondering if this is appropriate or is it better to use xtlogit when you want to add fixed effects?



  • #2
    Charlotte:
    as you're dealing with panel data, you should go -xtlogit-.
    However, please note that -xtlogit- will give you back conditional fixed effects.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Carlo,

      Thanks for the quick respons. When i use:

      Code:
      xtlogit unintentional GC, fe (for instance)
      I get the error "variable firmid not found". Is this what you mean with conditional? How can i solve this?

      Comment


      • #4
        Charlotte:
        not at all.
        Are you sure that you have -xtset- your data beforehand?
        That is:
        Code:
        xtset farmid year
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          I'm sorry i understood you incorrectly. Thank you.

          On another note, im also using a matched pair analysis so out of what im understanding, a conditional logistic regression would be also more appropriate in this case (instead of regular logit)?

          Comment


          • #6
            Charlotte:
            sorry but I'm unfamiliar with -clogit-.
            However, browsing the list can give you back some interesting threads on -clogit-.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              Thank you Carlo.

              Im still struggling. Im replicating an article who has included industry- and year fixed effects (but no firm). So, if include "xtset farmid year" wouldnt i then also include firm fixed effects?

              Moreover, if i include "fe", should is still include i.fiscalyear?

              Comment


              • #8
                Charlotte:
                I suspect that some of your predictors would be omitted due to collinearity.
                Kind regards,
                Carlo
                (Stata 18.0 SE)

                Comment


                • #9
                  Charlotte,

                  when you use fe in your xtlogit estimation, after having specified xtset farmid year, Stata takes care of the farm's fixed effects, not the year fixed effects. You can include i.year (are year and fiscalyear one and the same?) in your list of explanatory variables to capture time fixed effects. As Carlo Lazzaro points out you may lose predictors because of collinearity but you can always try it.
                  Alfonso Sanchez-Penalver

                  Comment


                  • #10
                    Thank you! Yes, year and fiscalyear is the same. What if don't want to include firm fixed effects, but only industry?

                    Is this doable, or is then my paneldata not structured appropriately?

                    Comment


                    • #11
                      Charlotte when you specify xtset farmid year, you are specifying two things: the variable that identifies the cross-sectional unit (farmid), and the variable that identifies the time unit (year). This is because the unit observation is a farm (firm?) at a given point in time. So that you see the relationship between xtlogit, fe and clogit, consider the following:
                      Code:
                      webuse union, clear
                      xtset idcode year
                      xtlogit union age grade, fe
                      clogit union age grade, group(idcode)
                      xtlogit's results are:
                      Code:
                      Conditional fixed-effects logistic regression   Number of obs      =     12035
                      Group variable: idcode                          Number of groups   =      1690
                      
                                                                      Obs per group: min =         2
                                                                                     avg =       7.1
                                                                                     max =        12
                      
                                                                      LR chi2(2)         =     31.17
                      Log likelihood  = -4534.5984                    Prob > chi2        =    0.0000
                      
                      ------------------------------------------------------------------------------
                             union |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                               age |   .0164108   .0041344     3.97   0.000     .0083075     .024514
                             grade |   .0846214   .0416914     2.03   0.042     .0029078    .1663351
                      ------------------------------------------------------------------------------
                      and clogit's results are:
                      Code:
                      Conditional (fixed-effects) logistic regression   Number of obs   =      12035
                                                                        LR chi2(2)      =      31.17
                                                                        Prob > chi2     =     0.0000
                      Log likelihood = -4534.5984                       Pseudo R2       =     0.0034
                      
                      ------------------------------------------------------------------------------
                             union |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                               age |   .0164108   .0041344     3.97   0.000     .0083075     .024514
                             grade |   .0846214   .0416914     2.03   0.042     .0029078    .1663351
                      ------------------------------------------------------------------------------
                      You can see how both return the same estimates in this case.

                      Now, with respect to your question about fixed effects at the industry level and not at the firm level. Since the observation unit is not the industry at a given point in time, but rather the firm at a given point in time, you have three levels in the nest: the top level is the industry, the middle level is the firm, and the bottom level is the year. You can always use logit with i.industryid as one of your explanatory variables, and that would capture the fixed effects at the industry level, and if you don't include i.farmid you won't capture fixed effects at the farm (firm?) level. There is nothing stopping you from capturing fixed effects at both levels by using xtlogit, fe or clogit, group() with i.industryid as an explanatory variable as well. I do not recommend using logit with i.farmid as an explanatory variable to capture the fixed effects at that level, particularly if you have many farms (firms?); xtlogit and clogit are the appropriate commands in that case.
                      Last edited by Alfonso Sánchez-Peñalver; 14 May 2017, 10:07.
                      Alfonso Sanchez-Penalver

                      Comment


                      • #12
                        Thank you for the clear explanation! And yes, firm it is (instead of farm)

                        Comment

                        Working...
                        X