Announcement

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

  • How do fixed effects regressions with time fixed effects / time dummies work in Stata?

    A fixed effects model (xtreg, fe in Stata) is estimated by substracting the means of each variable, resulting in a model of the form (this equation is from https://www.stata.com/manuals13/xtxtreg.pdf):
    Click image for larger version

Name:	Equation.JPG
Views:	1
Size:	11.2 KB
ID:	1635437


    How does this work if you include time fixed effects / time dummies in your regression? Obviously there is no average that can be subtracted from each individual time dummy, but is there some kind of overall time average that is subtracted from the time dummies? I would like some help in understanding this.
    Attached Files

  • #2
    Hi Carl
    To answer your question
    Obviously there is no average that can be subtracted from each individual time dummy, but is there some kind of overall time average that is subtracted from the time dummies? I would like some help in understanding this.
    So there IS an average substracted for each time dummy.
    consider a case with 2 individuals, One you observe on periods 1 2 and 3.
    the other one you observe on periods 1 and 2

    For the first observation, you would be including 2 dummies (periods 2 and 3 most likely). And you can estimate the within-person dummy mean, which in this case will be 1/3.
    For the second observation, you will include only 1 dummy (period 2?) and you will subtract the within mean of 0.5

    An easier way to think about it is that is to consider the time dummies as any other qualitative characteristic.

    HTH

    Comment


    • #3
      Carl:
      what Fernando helpfully explained is also covered in
      https://us.sagepub.com/en-us/nam/fixed-effects-regression-models/book226025, pages 12; 14-17 (just in case you need a reference).
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Originally posted by FernandoRios View Post
        Hi Carl
        To answer your question


        So there IS an average substracted for each time dummy.
        consider a case with 2 individuals, One you observe on periods 1 2 and 3.
        the other one you observe on periods 1 and 2

        For the first observation, you would be including 2 dummies (periods 2 and 3 most likely). And you can estimate the within-person dummy mean, which in this case will be 1/3.
        For the second observation, you will include only 1 dummy (period 2?) and you will subtract the within mean of 0.5

        An easier way to think about it is that is to consider the time dummies as any other qualitative characteristic.

        HTH
        Thanks for answering.
        Can you explain why the average would be 1/3 for the first observation and 0.5 for the second observation? Also to be clear, for each individual person it is the same average that you substract from each time dummy, right?

        Comment


        • #5
          So in my example individual 1 appears in the data 3 times. So the average of the any year specific dummy is 1/3.
          In the second case, that individual appears 2 times, so the average dummy is 1/2.

          Also, For each individual, the average that is substracted is individual specific.

          Perhaps would be easier if instead of thinking about "time" fixed effects you change it to "age" fixed effect. Every person experience "time" in the same way, but if they have lived for different number of years, each year represents a different "amount of time" of their life.

          HTH


          Comment


          • #6
            Originally posted by FernandoRios View Post
            So in my example individual 1 appears in the data 3 times. So the average of the any year specific dummy is 1/3.
            In the second case, that individual appears 2 times, so the average dummy is 1/2.

            Also, For each individual, the average that is substracted is individual specific.

            Perhaps would be easier if instead of thinking about "time" fixed effects you change it to "age" fixed effect. Every person experience "time" in the same way, but if they have lived for different number of years, each year represents a different "amount of time" of their life.

            HTH

            So for each individual, the average of the time dummy is the dummy divided by how many times they appear in the dataset (because the dummy is equal to 1 in one period and equal to 0 in all other periods)?

            Comment


            • #7
              Yes
              thats it

              Comment


              • #8
                Just a an addendum to Fernando's helpful posts. In the balanced case, you would be subtracting 1/T from each dummy, and that affects nothing in the estimation. In the unbalanced case, the demeaning is done using only the complete cases. So, even if individual 1 appears three times, if data are missing on one of the other covariates in a time period, it is the same as dropping the entire time period. If you are to do the estimation "by hand" it is important to use only the complete cases in computing the time averages. With an unbalanced panel it does matter that you substract off the 1/T(i) from each dummy, where T(i) is the number of complete cases.

                That's why it's best to usually let xtreg, fe with time dummies included to do the work for you. See my 2019 Journal of Econometrics paper on correlated random effects with unbalanced panels if you want further discussion. The regression-based Hausman test now requires the averages of the time dummies to be included.

                Comment

                Working...
                X