Announcement

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

  • xtset panelvar timevar followed by xtreg DV IV i.month i.year, fe

    Dear Statalisters,

    Code:
    xtset panelvar timevar
    xtreg DV IV i.month i.year, fe
    I'm using the above code with the variable DATE as the timevar, being a combination of month and year (e.g. 2010m4, 2010m5)
    The variable month contains the values 1,2,3,..,11,12
    The variable year contains the values 1995, 1996,...,2012, 2013

    I know that xtreg, fe controls for the fixed effects of the panelvar. However, does xtreg, fe also control for the time fixed effects?
    So, does my xtreg, fe code, including i.month i.year, control for more time fixed effects instead of using xtreg DV IV, fe (without i.month i.year)


  • #2
    RichardH (as per FAQ, please note the preference for real full surnames, too on this forum. You can re-register via the Contact us button at the bottom of the screen. Thanks):
    first off, my answer to your query would be indeed a question: did you run your panel regression without any predictor being dropped due to collinearity?
    Without other details concerning the results Stata gave you (that you are advised to post, in order to increase the chance to get helpful replies) had you run your model, I would focus on a two-way fe, keeping i.year but sacrifying i.month.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Ok, I'll use my real surname.

      No predictors were dropped due to collinearity.
      Which results can I give. I only know that the results differ when I run the regression with or without i.month i.year

      Does the timevar of xtset control for time fixed effects?

      Comment


      • #4
        Code:
         
         xtset panelvar timevar xtreg DV IV i.month i.year, fe
        with the variable DATE as the timevar, being a combination of month and year (e.g. 2010m4, 2010m5).

        @Carlo. Are you trying to tell me that I'm controlling for monthly fixed effects twice in total with my code (and controlling for year fixed effects only once in total with xtset and xtreg)? So, that I therefore should drop i.month in my regression?

        Does the timevar of xtset control for time fixed effects? If so, does xtset only control for monthly fixed effects in my case?

        Comment


        • #5
          While I can't speak for Carlo, I think he is making a different point. By using i.month and i.year you are controlling separately for year effects and month effects. In other words, including i.month is controlling for seasonal (monthly) effects that are independent of year. If that is what you intended to do, that is fine. But it is more common, I think, to see a single month-year variable, or just the year, used to control for time fixed-effects.

          Comment


          • #6
            Hello Clyde,

            If I understand you correctly, you mean that xtset timevar doesn't control for time fixed effects and that it's better to only include i.year in my regression if I don't want to control for seasonal (monthly) effects that are independent of the corresponding years.

            The effect of summer vacations and the winter are known to have an important effect on stock returns, which I'm researching. They even have made some special sentences to mark those effects. "Go away in May and remember to come back in September". Therefore, I'm using i.month and i.year instead of only using i.month. I use i.year to control for the financial crisis, the 'internetcrisis' etc.

            By the way, Sergio Correia told me that xtset timevar doesn't control for time fixed effects. So, it's nice to know that you agree on that.

            Comment


            • #7
              you mean that xtset timevar doesn't control for time fixed effects
              I think I agree with that, provided that you really meant

              Code:
              xtset panelvar timevar
              doesn't control for time fixed effects.

              Taken literally, -xtset timevar- does control for time fixed effects, but not for anything else.

              And yes, you have correctly understood what I meant about the impact of the i.month variable. I don't work in finance, and I'm unfamiliar with seasonal effects on stock prices. So I wasn't objecting to the use of i.month, I just wanted to make sure you understood what it does.

              Comment


              • #8
                Yes, I meant xtset panel timevar....only using timevar or xtset panel timevar would have made things more clear.

                That sounds logical. If my panelvar would have been the variable Year and I wouldn't use a timevar, then it controls for the fixed effects of the panelvar which would be the timevar Year.

                I understood that you weren't objecting the use of i.month, my apologies if it sounded like I was implying that

                Comment


                • #9
                  To reinforce on what I think Clyde is worried about:

                  I believe that you don't really want to use i.month i.year , because that is not really time fixed effects. What you want is to gen time = mofd(mdy(month, 1, year)), format it with format %tm time, and then add i.time . Only then will you be absorbing the fixed effects for every level of time in your sample.

                  Comment


                  • #10
                    Hello Sergio,

                    I'm already using xtset with the variable DATE as the timevar, being a combination of month and year (e.g. 2010m4, 2010m5), which is the same as your TIME variable suggestion. I also once thought of using i.date which is the same as i.time in your example.

                    However, what is the difference between using i.time and i.month i.year? What's the advantage of using i.time? You say that i.time absorbs more fixed effects but I don't understand how. Besides that, do you expect that i.time would lead to more or less significant results?

                    Comment


                    • #11
                      Richard:
                      Clyde explained my point much better that I did.
                      I would also consider Sergio's advice (and his revised i.time predictor) as a more efficient way to deal with what is seemingly (for me, at least) a two-way fixed effect model.
                      Eventually, I would propose a more general remark: have you ever seen in the literature of your research field panel data model like the one you were interested to implement (that is, with both i.year and i.month among the predictors)?. Or, put differently; what is the most widespread panel data model specification that you can find out in the literature concernng your research field for topic like yours?

                      As an aside, you can post also the results from your Stata session using the #-command included among Advance editor (A-icon button) capabilities.
                      Last edited by Carlo Lazzaro; 20 Nov 2014, 22:50.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        I wasn't able to find the exact meaning of a two-way fixed effect model. However, when I use the recommendation of Sergio some important control variables are dropped. They might not be needed in the tables but I'd like to keep them. Therefore, I want to know why i.time would be better than just using the split up version of i.month i.year

                        Carlo, that's a very good point. I have never seen i.year and i.month among the predictors but I haven't read more than 20 papers completely yet. Most of the time I only read the most interesting parts like the conclusions.

                        Comment


                        • #13
                          Richard: - you can find two-way effects model definition in Cameron AC, Trivedi PK. Microeconometrics. New York: Cambridge University Press, 2005: 738, and even more interesting for Stata useers, in Cameron AC, Trivedi PK. Microeconometrics using Stata. Revised edition. College Station, TX: Stata Press, 2010: 238; - if control variables are dropped due to collinearity, there's no way to keep them alive, unless you change the set of independent variables. But, again, the main issue rests on the consideration of what makes theoretically sense, in terms of predictors, in your research fields (especially if you have planned to submit a manuscript to disseminate the results of your research). - reading conclusions is a questionable habit even for busy people trying to maximize their grasp of the existing literature without engaging themselves in reserch endeavours. Despite researchers, teachers (and students) are busy pepole, too, they shoud make an extra effort and focus on the methods section of the paper to get what Authors did and assess if what they did is consistent with the results they published. Unfortunately, I would assume that you're no exception to this rule.
                          Kind regards,
                          Carlo
                          (Stata 19.0)

                          Comment

                          Working...
                          X