Announcement

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

  • Time Fixed effects

    Hello everyone,
    Just running a panel data regression, and the results for the Hausman test prove that Fixed effects is the best regression to run. The results I obtain are significant and seem to make sense considering the variables, however when I then test using testparm in order to see if I have to use time-fixed effects I obtain a result of Prob > F = 0.0011, which from my understanding means I have to use a i.Year variable in my regression, however when doing so my results for the fixed effect regression vary massively and don't seem to make any sense (coefficients that were ebfore negative now become positive,etc…)?
    I have observations from years 2010,2012,2014,2016.
    I am not sure how to proceed or explain this?
    Many thanks

  • #2
    Pepito:
    no wonder that the results change when using a different specification.
    If you're concerned about the flip of your coefficients, you should consider testing your model for possible misspecification(s).
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Thank you for the help,
      is there any way to test this in Stata?

      Comment


      • #4
        Pepito:
        yes, there is.
        Just take a look at -linktest- in Stata .pdf manual for more details:
        Code:
        . use "http://www.stata-press.com/data/r15/nlswork.dta"
        (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
        
        . xtreg ln_wage age, fe
        
        Fixed-effects (within) regression               Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-sq:                                           Obs per group:
             within  = 0.1026                                         min =          1
             between = 0.0877                                         avg =        6.1
             overall = 0.0774                                         max =         15
        
                                                        F(1,23799)        =    2720.20
        corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000
        
        ------------------------------------------------------------------------------
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   .0181349   .0003477    52.16   0.000     .0174534    .0188164
               _cons |   1.148214   .0102579   111.93   0.000     1.128107     1.16832
        -------------+----------------------------------------------------------------
             sigma_u |  .40635023
             sigma_e |  .30349389
                 rho |  .64192015   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        F test that all u_i=0: F(4709, 23799) = 8.81                 Prob > F = 0.0000
        
        . predict fitted, xb
        (24 missing values generated)
        
        . g sq_fitted=fitted^2
        (24 missing values generated)
        
        . xtreg ln_wage fitted sq_fitted, fe
        
        Fixed-effects (within) regression               Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-sq:                                           Obs per group:
             within  = 0.1087                                         min =          1
             between = 0.1006                                         avg =        6.1
             overall = 0.0865                                         max =         15
        
                                                        F(2,23798)        =    1451.88
        corr(u_i, Xb)  = 0.0440                         Prob > F          =     0.0000
        
        ------------------------------------------------------------------------------
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              fitted |   7.143466    .478902    14.92   0.000     6.204788    8.082144
           sq_fitted |  -1.816243    .141469   -12.84   0.000    -2.093531   -1.538955
               _cons |  -5.167788   .4037984   -12.80   0.000    -5.959259   -4.376317
        -------------+----------------------------------------------------------------
             sigma_u |   .4039153
             sigma_e |  .30245467
                 rho |  .64073314   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        F test that all u_i=0: F(4709, 23798) = 8.74                 Prob > F = 0.0000
        
        . test sq_fitted
        
         ( 1)  sq_fitted = 0
        
               F(  1, 23798) =  164.83
                    Prob > F =    0.0000
        
        .
        
        
        .
        *as the test on the squared fitted values reaches statistical significance, the regression model is misspecified (possibly more predictors and/or interaction would be helpful)*
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Thanks a lot for your help Carlo. After running such steps I obtain:

          test sq_fitted

          ( 1) sq_fitted = 0

          F( 1, 49) = 0.54
          Prob > F = 0.4562

          Which I suppose means the test doesn't reach statistical significance? Not sure how to interpret this.
          In regards to my original concern I was just wondering because I am not sure how to explain that after achieving
          Prob > F = 0.0011 in the testparm, and subsequently looking at the results with a i.Year variable the coefficients for all variables become insignificant and that for one variable it changes from
          -2.434451 (without i.Year in the regression) to 1.534432 (WITH i.year as a variable in regression)
          Once again thanks a lot for your help
          Pepito

          Comment


          • #6
            Pepito:
            your model shows no evidence of specification.
            I would recommend you to post what you typed and what Stata gave you back (as per FAQ) via CODE delimiters.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment

            Working...
            X