Announcement

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

  • time effects in FE and pooled models

    Dear all,

    I am currently working on a research topic related on the renewable energy determinants.
    I am estimating some regression models with the objective of evaluating the effectiveness of support schemes on the diffusion of renewables in Europe. I have some dummies time invariant e time variant. When I run a model with time-variant dummy (equal 1 for the state and for time adoption) and control for countries I don t have problems, but when I control for time dummies the sign of the coefficient changes. The same happens for time invariant dummies in a pooled model.

    The models are:

    Model 1
    reg Y(it) dummy-timevariant(it) i.id , r --> the sing of coefficient is positive
    reg Y(it) dummy-timevariant(it) i.id i.time, r--> the sing of coefficient is negative

    model 2
    reg Y(it) dummy-timeinvariant(i) , r--> the sing of coefficient is positive
    reg Y(it) dummy-timeinvariant(i) i.time, r--> the sing of coefficient is negative

    I have 21 years and 28 countries. The depend variable is the share of renewable electricity or renewable capacity and the indipendent variable is the feed-in tariff time variant in the first model and time invariant in the second model.


    I would very much appreciate some thoughts on this problem.
    Thanks in advance!

    Matteo

  • #2
    Matteo:
    welcome to this forum.
    From your description, you're probably dealing with a N>T panel dataset.
    Hence, I'm not clear why you're not using -xtreg-.
    On the top of that, please note that, if you have a panel dataset and you stick with -regress- to analyse it (which is rarely the way to go, though), you should impose -cluster- standard errors (since you have non-independent observations) instead of the -robust- option, which, under -regress-, takes heteroskedasticity only into account.
    That said, you will surely increase your chances of getting helpful replies by posting what you typed and what Stata gave you back via CODE delimiters (see the FAQ on this and other posting-related topics). Thanks.
    As you can easily figure out, it is virtually impossible to reply positively to such a precise question like the one you posted without taking a look at a regression outcome table.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thanks for your reply,
      I used the reg command for time-invariant dummy, while I used xtreg for the dummy time-variant

      TIME VARIANT_DUMMY
      Model 1:

      xtreg Capacity_ResTotal_Mw_proc supportscheme , fe vce (cluster id)

      Fixed-effects (within) regression Number of obs = 588
      Group variable: id Number of groups = 28

      R-sq: Obs per group:
      within = 0.0643 min = 21
      between = 0.0913 avg = 21.0
      overall = 0.0364 max = 21

      F(1,27) = 41.18
      corr(u_i, Xb) = 0.1266 Prob > F = 0.0000

      (Std. Err. adjusted for 28 clusters in id)
      -------------------------------------------------------------------------------
      | Robust
      Capacity_Re~c | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      supportscheme | .000118 .0000184 6.42 0.000 .0000802 .0001557
      _cons | .0004368 .0000158 27.61 0.000 .0004044 .0004693
      --------------+----------------------------------------------------------------
      sigma_u | .00058012
      sigma_e | .00014143
      rho | .94389913 (fraction of variance due to u_i)
      -------------------------------------------------------------------------------




      xtreg Capacity_ResTotal_Mw_proc supportscheme i.time, fe vce (cluster id)


      Fixed-effects (within) regression Number of obs = 588
      Group variable: id Number of groups = 28

      R-sq: Obs per group:
      within = 0.6257 min = 21
      between = 0.0913 avg = 21.0
      overall = 0.0296 max = 21

      F(21,27) = 48.57
      corr(u_i, Xb) = -0.0192 Prob > F = 0.0000

      (Std. Err. adjusted for 28 clusters in id)
      -------------------------------------------------------------------------------
      | Robust
      Capacity_Re~c | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      supportscheme | -.0000428 .0000386 -1.11 0.277 -.0001221 .0000364
      |
      time |
      1996 | 7.72e-06 5.23e-06 1.48 0.151 -3.00e-06 .0000185
      1997 | .0000196 .0000104 1.89 0.070 -1.71e-06 .0000409
      1998 | .0000277 .0000136 2.04 0.052 -1.96e-07 .0000556
      1999 | .0000347 .0000168 2.06 0.049 1.22e-07 .0000692
      2000 | .0000434 .0000239 1.82 0.080 -5.59e-06 .0000923
      2001 | .0000506 .000027 1.87 0.072 -4.77e-06 .0001059
      2002 | .0000573 .0000296 1.94 0.063 -3.44e-06 .0001181
      2003 | .0000738 .0000348 2.12 0.043 2.37e-06 .0001451
      2004 | .0000872 .0000366 2.38 0.025 .0000121 .0001624
      2005 | .0000975 .0000397 2.46 0.021 .000016 .000179
      2006 | .0001069 .0000418 2.55 0.017 .000021 .0001927
      2007 | .0001196 .0000438 2.73 0.011 .0000297 .0002095
      2008 | .000134 .000046 2.91 0.007 .0000396 .0002284
      2009 | .0001582 .00005 3.17 0.004 .0000557 .0002607
      2010 | .0001922 .0000537 3.58 0.001 .0000821 .0003023
      2011 | .0002357 .0000579 4.07 0.000 .0001169 .0003545
      2012 | .0002861 .0000615 4.65 0.000 .0001599 .0004123
      2013 | .0003234 .0000652 4.96 0.000 .0001896 .0004572
      2014 | .0003623 .0000604 6.00 0.000 .0002384 .0004863
      2015 | .0003944 .0000634 6.22 0.000 .0002644 .0005244
      |
      _cons | .0004413 .0000169 26.11 0.000 .0004066 .000476
      --------------+----------------------------------------------------------------
      sigma_u | .00058785
      sigma_e | .0000911
      rho | .97654729 (fraction of variance due to u_i)
      -------------------------------------------------------------------------------



      the sign of support scheme variable change after controlling time effects.

      Comment


      • #4
        Matteo:
        some comments about your post:
        - I don't remember (but it might be my fault) to have ever heard about splitting regression models to analyze time-variant and time-invariant predictors. Hence, no surprise that you get different results with two different regression models.
        - while is it true that the -fe- machinery wipes out time-invariant predictors, you can always compare -fe- vs -re- specification via -hausman- (if you impose default standard errors) or, in Stata, via the user-written programme -xtoverid- (typer -search xtoverid- from within Stata to spot and install it) when you invoke non-default standard errors..
        - while clustered standard errors are mandatory under -regress- whenever you analyze non-independent observations, under -xtreg- you should invoke cluster/robust options (unlike -regress-, they do the same job under -xtreg-) when you detect/suspect heteroskedasticity and/or autocorrelation (actually, autococorrelation can bite harder than heteroskedasticity with such a wide time-series dimension);
        - you can check whether years are jointly significant via -testparm(i.year)- after -xtreg-.
        Last edited by Carlo Lazzaro; 26 Jun 2018, 05:33.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thanks for the reply.
          but in the attached model the variable is time-variant; the time-invariant I did not attach even if I find the same problems.


          The test F on time effects is significant (as you can see below) . This problem it also occurs when I use RE.


          testparm i.time

          ( 1) 1996.time = 0
          ( 2) 1997.time = 0
          ( 3) 1998.time = 0
          ( 4) 1999.time = 0
          ( 5) 2000.time = 0
          ( 6) 2001.time = 0
          ( 7) 2002.time = 0
          ( 8) 2003.time = 0
          ( 9) 2004.time = 0
          (10) 2005.time = 0
          (11) 2006.time = 0
          (12) 2007.time = 0
          (13) 2008.time = 0
          (14) 2009.time = 0
          (15) 2010.time = 0
          (16) 2011.time = 0
          (17) 2012.time = 0
          (18) 2013.time = 0
          (19) 2014.time = 0
          (20) 2015.time = 0

          F( 20, 27) = 27.79
          Prob > F = 0.0000

          Comment


          • #6
            Matteo:
            - jointly significant -i.time- means that time plays a relevant role in causing variation of the conditional mean of the dependent variable within each panel (as -fe- sp0ecification focuses on within variation);
            - in my first point in my previous reply, I meant that it does not seem correct to separate time-varying from time-invariant predictors and analyze them in two different regression models
            ...I used the reg command for time-invariant dummy, while I used xtreg for the dummy time-variant...
            ;
            - you mention the -re- specification: what does -xtoverid- advise you about?
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Thanks for the reply.
              -I never used the xtoverid!
              -I used the reg command for time-invariant dummy, while I used xtreg for the dummy time-variant... because with FE the coefficient of the interest variable is omitted. How can I control i.id factors with time invariant dummy ?

              Comment


              • #8
                Matteo:
                -xtoverid- (type -search xtoverid- from within Stata to spot and install it) replaces -hausman- when you invoke non-default standard errors;
                -
                I used xtreg for the dummy time-variant... because with FE the coefficient of the interest variable is omitted
                : I still fail to get why you did not check whether -re- specification fits your data better thn the -fe- one, as you cannot
                control i.id factors with time invariant dummy
                with -fe-.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Thanks for the reply.

                  When I run a model with time invariant dummy (as you can see below), FE estimation omitted his coefficient.



                  xtreg Y dummy_timeinvariant , fe vce (cluster id)
                  note: dummy_timeinvariant omitted because of collinearity

                  Fixed-effects (within) regression Number of obs = 588
                  Group variable: id Number of groups = 28

                  R-sq: Obs per group:
                  within = . min = 21
                  between = . avg = 21.0
                  overall = . max = 21

                  F(0,27) = .
                  corr(u_i, Xb) = . Prob > F = .

                  (Std. Err. adjusted for 28 clusters in id)
                  -----------------------------------------------------------------------------------------
                  | Robust
                  grosselectricitygener~o | Coef. Std. Err. t P>|t| [95% Conf. Interval]
                  ------------------------+----------------------------------------------------------------
                  dummy_timeinvariant | 0 (omitted)
                  _cons | .2245082 . . . . .
                  ------------------------+----------------------------------------------------------------
                  sigma_u | .19598141
                  sigma_e | .08240192
                  rho | .84977305 (fraction of variance due to u_i)
                  -----------------------------------------------------------------------------------------





                  With comand "regress Y dummy_timeinvariant i.id, vce (cluster id)" the id1 e id28 is omitted.

                  Comment


                  • #10
                    Matteo:
                    no surprise that -fe- specification omits time-invariant predictors: this is exactly as expected; that's why I would investigate whether -re- specification fits your data better, as it does not omit coefficients of time-invariant predictors. You may want to take a look at any decent econometrics textbook to have an idea of what is going on when you go -fe- or -re- ;
                    - it is strange that an observation is omitted under -regress- whereas it is maintained in -e(sample)- under -xtreg-.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      The Hausman test for time-variant dummy is favors to FE (chi2= 14.09);

                      with time-invariant dummy, when I run this models:
                      • reg Y dummy_timeinvariant i.id i.time, vce(cluster id)
                      • xtreg Y dummy_timeinvariant i.id i.time, vce(cluster id)
                      I obtain satisfying results, but id15 and id28 are omitted!! what is the reason?is it way forward?

                      Comment


                      • #12
                        Matteo:
                        -if you add i.id (I assume that -id- indicates your panel units), Stata should have issued a warning message, such as -maxvar too small-;
                        - besides, adding -i.id- in -xtreg- equation creates a collinearity problem with the fixed effect;
                        - perhaps you may want to share an excerpt/example of your dataset via -dataex- (see -help dataex-);
                        - if you have invoked cluster/robust standard errors before -hausman-, -hausman- should ahe returned a warning message, as it allows default standard errors only; if you have invoked cluster/robust option after -hausman-, the -hausman- outcome is not informative; use -xtoverid-, instead.
                        The following toy-example covers this issue (please note that I have to add the old-fashioned -xi:- prefix because -xtoverid- was released before the factor variable notation (see -help fvvralist-) became part of the Stata built-in commands):
                        Code:
                        use "http://www.stata-press.com/data/r15/nlswork.dta"
                        . quietly xi: xtreg ln_wage i.race age, fe vce(cluster idcode)
                        
                        . estimates store fe
                        
                        . quietly xi: xtreg ln_wage i.race age, re vce(cluster idcode)
                        
                        . estimates store re
                        
                        . hausman fe re
                        hausman cannot be used with vce(robust), vce(cluster cvar), or p-weighted data
                        r(198);
                        
                        . xtoverid
                        
                        Test of overidentifying restrictions: fixed vs random effects
                        Cross-section time-series model: xtreg re  robust cluster(idcode)
                        Sargan-Hansen statistic  12.062  Chi-sq(1)    P-value = 0.0005
                        In the toy-example above, -xtoverid- outcome rejects the null and points to -fe- specification.
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment

                        Working...
                        X