Announcement

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

  • Fixed effect - time & country fixed vs. time-country fixed

    Hi, I am running two fixed effect regressions
    - one with time fixed effect and country fixed effect
    - one with time-country fixed effect (time and country pair)

    The results - signs of coefficients are opposite in first and in second case. I understood that time-country fixed fair is more demanding. But I am confused why signs are different.
    How should I interpret them?

    Thank you very much for the comments!





  • #2
    Su:
    from your description, your models are different: hence, no wonder that they produce conflicting results (by the way, I would stick with the first one).
    In your second code, you broke the panel data structure of your data and created a -newid- instead, based on original id a time pairs.
    If this reply were not helpful, please. as per FAQ, provide what you typed and what Stata gave you back, along with an example/excerpt of your data via -dataex-. Thanks.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      Thank you very much for the reply.
      My regression is the same as both models have the same structure except fixed effect. What I want to do is to variate the fixed effect : one with time FE and country FE and second one with time-country pair FE.
      Could you please review my models?

      xtset country year
      xtreg depvar var1 var2 i.year, fe cluster(country)

      xtset country-year
      xtreg depvar var1 var2 i.year, fe cluster(country-year)

      would it be any other way to diversify country-year FE?

      Thank you so much!

      Comment


      • #4
        Su:
        I do not think that "diversifying" country-year FE helps.
        As already replied, I would stick with your fisrt code that makes methodological sense.
        As per the folowing toy-example, you will see that, as expected, your models are not identical in the results they give (please aloso note the difference in the number of groups):
        Code:
        . use "http://www.stata-press.com/data/r15/nlswork.dta"
        (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
        
        . xtset idcode year
               panel variable:  idcode (unbalanced)
                time variable:  year, 68 to 88, but with gaps
                        delta:  1 unit
        
        . xtreg ln_wage age, fe vce(cluster idcode)
        
        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,4709)         =     884.05
        corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000
        
                                     (Std. Err. adjusted for 4,710 clusters in idcode)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   .0181349   .0006099    29.73   0.000     .0169392    .0193306
               _cons |   1.148214   .0177153    64.81   0.000     1.113483    1.182944
        -------------+----------------------------------------------------------------
             sigma_u |  .40635023
             sigma_e |  .30349389
                 rho |  .64192015   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . egen idcode_year=group(idcode year)
        
        . xtset idcode_year
               panel variable:  idcode_year (balanced)
        
        . xtreg ln_wage age, fe vce( cluster idcode_year )
        note: age omitted because of collinearity
        
        Fixed-effects (within) regression               Number of obs     =     28,510
        Group variable: idcode_year                     Number of groups  =     28,510
        
        R-sq:                                           Obs per group:
             within  =      .                                         min =          1
             between =      .                                         avg =        1.0
             overall =      .                                         max =          1
        
                                                        F(0,28509)        =          .
        corr(u_i, Xb)  =      .                         Prob > F          =          .
        
                               (Std. Err. adjusted for 28,510 clusters in idcode_year)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |          0  (omitted)
               _cons |   1.674944          .        .       .            .           .
        -------------+----------------------------------------------------------------
             sigma_u |  .47810418
             sigma_e |          .
                 rho |          .   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        .
        Again, If this reply were not helpful, please. as per FAQ, provide interested listers with an example/excerpt of your data via -dataex-. Thanks.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X