Announcement

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

  • Panel data set, including several fixed effects

    Hello,

    I have a panel data set with the following main regression

    Panel variable(1-357): Bank_Number; Time Variable (1-3): ST_Projection


    regress y x1 x2 x3 x4


    How do I include year fixed effects (variable: ST_Year) and country fixed effects (Variable: Country)?


    Thanks in advance for the answer.
    Last edited by Natalie Peltzer; 17 Jan 2023, 07:41.

  • #2
    Originally posted by Natalie Peltzer View Post
    How do I include year fixed effects (variable: ST_Year) and country fixed effects (Variable: Country)?
    Why not bank fixed effects? Can you guarantee that there is no bank-level heterogeneity? To include country and year effects, you need both the country identifier and time variable to be numeric. If the former is a string variable, see

    Code:
    help encode
    Then, the regression is simply

    Code:
    xtset Country
    xtreg y x1 x2 x3 x4 i.ST_Year, fe cluster(Bank_Number)
    or

    Code:
    regress y x1 x2 x3 x4 i.Country i.ST_Year, cluster(Bank_Number)

    Comment


    • #3
      Originally posted by Andrew Musau View Post

      Why not bank fixed effects? Can you guarantee that there is no bank-level heterogeneity? To include country and year effects, you need both the country identifier and time variable to be numeric. If the former is a string variable, see

      Code:
      help encode
      Then, the regression is simply

      Code:
      xtset Country
      xtreg y x1 x2 x3 x4 i.ST_Year, fe cluster(Bank_Number)
      or

      Code:
      regress y x1 x2 x3 x4 i.Country i.ST_Year, cluster(Bank_Number)
      Thanks Andrew!

      The exercise from my professor said not to include bank fixed-effects.

      If I only want to include year fixed effects the Code would be?

      Code:
      regress y x1 x2 x3 x4 i.ST_Year, cluster(Bank_Number)

      Comment


      • #4
        Is this homework? If so, see #4 https://www.statalist.org/forums/help#adviceextras

        Comment


        • #5
          No, its not homework that will be graded, just some extra exercises for us to practice

          Comment


          • #6
            Originally posted by Natalie Peltzer View Post
            If I only want to include year fixed effects the Code would be?

            Code:
            regress y x1 x2 x3 x4 i.ST_Year, cluster(Bank_Number)
            Correct. In linear fixed effects models, you can include fixed effects using indicators for each level of the FE variable (omitting one indicator).
            Last edited by Andrew Musau; 17 Jan 2023, 08:42.

            Comment

            Working...
            X