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

  • No Intercept: A Panel Fixed Effects Model

    I want to estimate a panel fixed effects model with both firm and year fixed effects but with no intercept.
    It appears that xtreg does not have the option
    . In addition, my dataset is large and I estimate the fixed effect model in a recursive process so reg with dummy variables for the firm and year effects is not possible.

    Is there anyway to estimate fixed effects model without intercept ?

  • #2
    Hi Lisa,
    1. xtreg, fe already reports no intercept, so there is no need for -noconstant- (note that technically, xtreg,fe it has one constant for every firm)
    2. I'm not sure what do you mean by "recursive process", but to deal with multi-way fixed effects you can use e.g. reghdfe from SSC


    • #3
      Hi Sergio
      Thanks for your quick response
      1- As for extreg, fe I actually get an intercept (look below). So, the regression is estimated with an intercept. I want to estimate it without intercept.

      . xtreg x l.x,fe
      Fixed-effects (within) regression               Number of obs      =    287928
      Group variable: gvkey                           Number of groups   =     12372
      R-sq:  within  = 0.7424                         Obs per group: min =         1
             between = 0.9188                                        avg =      23.3
             overall = 0.8567                                        max =       176
                                                      F(1,275555)        = 794061.20
      corr(u_i, Xb)  = 0.4688                         Prob > F           =    0.0000
                 x |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                 x |
               L1. |   .8875262    .000996   891.10   0.000     .8855741    .8894783
             _cons |   .0976601   .0009011   108.38   0.000      .095894    .0994261
           sigma_u |  .17726568
           sigma_e |  .23682555
               rho |  .35908256   (fraction of variance due to u_i)
      F test that all u_i=0:     F(12371, 275555) =     2.09       Prob > F = 0.0000

      2- I mean by recursive process : an expanding window of rolling regressions that adds one time period each time the panel is re-estimated.
      As for reghdfe, the help files reports

      Possible Pitfalls and Common Mistakes
             1.  (note: as of version 2.1, the constant is no longer reported) Ignore the constant;
                 it doesn't tell you much. If you want to use descriptive stats, that's what the
                 summarize() and estat summ commands are for.  Even better, use noconstant to drop
                 it (although it's not really dropped as it never existed on the first place!)

      When I add noconstant, it says that this option is not available so I do not really know if adds a constant or not?


      • #4
        Panel fixed effects model (xtreg fe) does report an intercept (constant). there's even a stata FAQ entry regarding this:


        • #5
          Hi again
          but in #3 as you see the constant is reported! I do not get that.


          • #6
            Sorry, for some reason I forgot that xtreg does report _cons based on the values of the fixed effects.

            Let me explain a bit about the constant (this is appliable for both xtreg,fe and reghdfe):

            When you estimate a model with fixed effects, it is equivalent as if you added a constant for every firm. You never include a constant regressor because there is no need for it, and in fact if you did that would be a mistake as it would be collinear with the firm dummies.

            So don't worry about the constant, as it is irrelevant to report it or not given that you already have a fixed effect for each firm.


            • #7
              Following your point:
              Given that the fixed effects are fixed effects for each firm, and there is no constant in the xtreg estimation, then why when I report the descriptive statistics of these fixed effects , they show that the mean is zero. I would have expected their mean to be equal to the mean of the dependent variable if so?


              • #8
                Also from the link in post #4:

                "The results that xtreg, fe reports have simply been reformulated so that the reported intercept is the average value of the fixed effects"

                I understand that the cons reported after extreg, fe should be then equal to the estimated fixed effects from this post estimation command
                predict fixed_effects,u
                I tried this on the data but I found that the _cons reported in the extreg output is different from the one estimated using the predict command above.

                I don not then understand the explanation in the stata link!!
                Last edited by Lisa Wilson; 03 Oct 2016, 15:33.


                • #9
                  The "constant term" reported by -xtreg, fe- is calculated so that the average of the values of u reported by -predict- will be zero. But you have to remember that the average referred to is one in which each panel member's u is counted once. If you have a balanced panel, it makes no difference. But if the panel is unbalanced, to get the average to come out to zero you have to select a single observation from each panel and average the u's only on those selected observations to be assured of getting zero.

                  Saying that the average of the u's reported by predict is 0 is equivalent to saying that the constant term is set to the average of the fixed effects estimates that you would have gotten if you were able to specify a -noconstant- option. As pointed out in the link in #4 above, the "constant term" and the "fixed effects" are inherently unidentified, and values of them can only be obtained by imposing some arbitrary constraint. StataCorp chose to impose the constraint that the sum of the "fixed effects" be zero. The rationale for that choice is explained in the link in #4.


                  • #10
                    Hi Clyde
                    Thank you for your reply.

                    Does this mean that if one wants to estimate both firm fixed effects and time fixed effects when the panel is unbalanced, the following code might be appropriate:

                    xtreg Y x1 x2  i.time , fe
                    gen fixed=   _b[_cons]
                    Therefore, fixed here will be the sum of the firm fixed effects and the time fixed effects. Is this correct ?



                    • #11
                      No. _b[_cons] will still be the constant that allows the firm fixed effects to sum to zero. The time fixed effects are not directly calculated by the command you show. They are, like firm fixed effects, inherently unidentified. Unlike the firm fixed effects, a different constraint is imposed: the effect of the base value of time is set to zero, and the other effects are calculated by the expected mean outcome difference from that in the base level of time. The panel fixed effects are identified differently from the time fixed effects when you use -xtreg, fe-. If you use -reghdfe-, I believe (though I am not sure), all of the fixed effects are handled in the same way, as described by its author, Sergio Correa.


                      • #12
                        A) Does this mean that the firm fixed effects without this constant would not sum to zero?

                        B) Then, if one wants to estimate all fixed effects together as one variable capturing fixed effects in the panel model, what would be the proper way to do so using xtreg, fe or reghdfe ?


                        • #13
                          Hi Lisa,

                          What do you ultimately want to do, i.e. why do you need to have a regression with no intercept?
                          (I ask just because your question might be a case of the very common xy problem)


                          • #14
                            First, I agree with Sergio's question in #13: you are persevering at a problem that strikes most of us as odd, something nobody else really cares about. So perhaps you see this as a means towards some other end. If so, better to state the larger purpose.

                            With regard to #12: that is correct. Without the constant, (equivalently, setting the constant to zero), would increase each panel fixed effect by an amount equal to the constant. So the sum would then be N*the original constant, where N is the number of panels.

                            For B) you could do something like this:

                            xtreg y x i.time, fe
                            predict e, e
                            predict xb, xb
                            levelsof time, local(times)
                            gen time_term = .
                            foreach t of local times {
                                 replace time_term = _b[`t'.time] if time == `t'
                            gen combined_fixed_effects = y - (xb-time_term) - e


                            • #15
                              Hi Both
                              1) the purpose:
                              a ratio of accounting value of equity to the stock price (BtP) reflect the delay in accounting recognition of economic shocks that are reflected in stock prices (delay), and the tendency of firms to record assets lower than their fair value (bias). In order to measure both component of the BtP ratio, the following regression is used:

                              BtP(t)= intercept+ firm fixed effects + time fixed effects+ a* lags of change in stock prices + error(t)

                              The a*lag of change in stock prices is a measure of the delay component
                              The firm fixed effects and time fixed effects are used as a measure of the firm bias.

                              These components are usually measured using an increasing window rolling regression where the components are measured for the last observations in each estimated panel.

                              I find a helpful post here
                              However, in this post time fixed effects are not estimated.

                              My objective is to measure both the delay component and bias component and then create a measure of equally weighted delay in the quarter (average delay) and a measure of equally weighted bias in the quarter (average bias)

                              2) In post #14, Clyde suggests a method to calculate time effects. I propose another method but I am not sure if the code here would calculate what it is meant to calculate:

                              gen firm=.
                              gen delay=.
                              gen period=.
                              summ Yearquarter
                              local first = r(min)+ 10
                              local last = r(max)
                              forvalues p = `first'/`last' {
                                  capture noisily xtreg BtP price L.price l2.price i.Yearquarter if inrange(Yearquarter, `p'-10, `p'), fe
                                 if c(rc) == 0 {
                                      predict firm_effect, u
                                      replace delay = _b[price]*price + _b[L.price]*L1.price + _b[L2.price*L2.price if Yearquarter == `p'
                                      replace firm = firm_effect if Yearquarter == `p'
                                      capture noisily replace period = _b[`p'.Yearquarter] if yearquarter == `p'
                                      drop firm_effect
                               gen bias=firm+period
                              gen Mean_delay=mean(delay), by (Yearquarter)
                              sum Mean_bias=mean(bias), by (Yearquarter)

                              3) From your explanation, I assume that my regression above is estimated without constant and that the reported constant does not represent the average of both firm and time effects.

                              Are my points correct now?