Announcement

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

  • Multiple fixed effects using logit models

    Hi,

    I have a firm-year level panel data. The dependent variable is a dummy variable. I would like to include firm and year fixed effect with firm-level clustering (if possible). Anyone knows how to do this?


  • #2
    Code:
    xtset firm year
    xtlogit y x1-xn i.year, fe

    will estimate a conditional fixed effects logit model with year dummies. With panel data, the reason for clustering is usually due to concerns about serial correlation and heteroscedasticity. If this is the case, you should not use the conditional FE logit estimator. See #2 of https://www.statalist.org/forums/for...tandard-errors.

    Comment


    • #3
      Andrew has provided great advice! You may want to compare your results to a benchmark / baseline linear probability model (LPM), especially if most of your regressors are binary as well. The LPM model is fit using
      Code:
      regress

      Comment


      • #4
        Originally posted by Andrew Musau View Post
        Code:
        xtset firm year
        xtlogit y x1-xn i.year, fe

        will estimate a conditional fixed effects logit model with year dummies. With panel data, the reason for clustering is usually due to concerns about serial correlation and heteroscedasticity. If this is the case, you should not use the conditional FE logit estimator. See #2 of https://www.statalist.org/forums/for...tandard-errors.
        Thanks, Andrew. If I need to use both firm fixed and year fixed effects, then should I just use the following? Or "fe" already stands for the firm-fixed effect?
        xtlogit y x1-xn i.year i.firmID, fe

        Comment


        • #5
          You declare the panel identifier in the xtset command

          xtset firm year
          So yes, the firm fixed effects are conditioned out of the likelihood with

          xtlogit y x1-xn i.year, fe

          Comment


          • #6
            Helen Chang you may want to check out the community-contributed commands
            Code:
            logitfe
            and
            Code:
            probitfe

            Comment


            • #7
              Thank you everyone!! Just a follow up question. I noticed that the number of observation using the logit model is much smaller than the sample size using the OLS regression. Is it normal?

              Comment


              • #8
                Originally posted by Helen Chang View Post
                Thank you everyone!! Just a follow up question. I noticed that the number of observation using the logit model is much smaller than the sample size using the OLS regression. Is it normal?
                "note: multiple positive outcomes within groups encountered.
                note: 1,356 groups (10,895 obs) dropped because of all positive or
                all negative outcomes."
                This is what I received from Stata.

                Comment


                • #9
                  See this thread for an answer to your question: https://www.statalist.org/forums/for...n-lead-to-bias.

                  Comment

                  Working...
                  X