Announcement

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

  • reg and xtreg,fe/xtreg, re

    Hi everyone,

    I am currently working with a country-year panel dataset where N > T. I am a bit confused about the research and running the model. I'm not good at it.

    Specifically:
    1. Pooled OLS: If I run a Pooled OLS regression (reg in Stata) and manually include dummy variables for both country and year (Time and Country Fixed Effects), is this still considered "Pooled OLS"? My command is: reg y x1 x2 country year
    2. xtreg, fe vs. reg with dummies: So what if I use the fixed effects command with year dummies (e.g., xtreg y x1 x2 year, fe)
    3. Additionally, I have come across a paper that used 'Pooled OLS with Fixed Effects'. In their regression tables, they show that both country and year fixed effects are included.

      This leads to my confusion: If a model includes both entity and time dummies, isn't it technically a FE model (specifically a Two-Way Fixed Effects (TWFE) estimator)?
    Thank you!
    Click image for larger version

Name:	Screenshot (705).png
Views:	1
Size:	114.9 KB
ID:	1785080
    Click image for larger version

Name:	Screenshot (704).png
Views:	1
Size:	73.5 KB
ID:	1785081

  • #2
    Dung:
    -xtreg y <predictors> <controls> i.timevar, fe vce(cluster panelid)- is the way to go.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Dung,

      I've read your two posts on this same topic, and I understand that the issue lies only in the terminology, and the reviewer seems a bit conservative on this point.
      The two-way effects model has the form:
      y_it = X_it*beta + u_i + v_t + e_it (1)
      If u_i and v_t are correlated with X, they are classified as fixed effects (FE), and (1) is called a two-way fixed effects model (TWFE).

      To estimate the parameters of interest (beta), one can use several different methods based on OLS:
      1. Pooled OLS on original data + individual/time dummies (reg + dummies)
      2. Pooled OLS on transformed data (demeaned data) (xtreg, areg, reghdfe)
      These two methods differ mainly in computational performance, especially when the number of cross-sectional units becomes large, as in labor/firm panel data. In my opinion, you are absolutely right to call your results OLS + dummies. However, the term TWFE is more commonly used, while when referring to Pooled OLS, it is usually associated with a model where u_i = v_t = 0.

      The main point I want to warn you about concerns your use of the xtscc command to calculate the Driscoll-Kraay Standard Error (DKSE).
      • First, DKSE is designed for large T panels, which is probably not suitable for your case.
      • Next, the fe option only adjusts in OWFE, not TWFE (your case).
      • Finally, DK-OWFE (xtscc y x, fe lag()) and DK-OLS+dummies (xtscc y x i.id, lag()) give different standard errors because DK-OWFE does not adjust for degrees of freedom when calculating the standard error.
      The code below illustrates this:

      Code:
      webuse abdata, clear
      qui {
      reg n k w i.id
      estimates store ols_dum
      xtreg n k w, fe
      estimates store fe
      xtscc n k w i.id, lag(1)
      estimates store dk_ols_dum
      xtscc n k w, fe lag(1)
      estimates store dk_fe
      }
      esttab ols_dum fe dk_ols_dum dk_fe, b(7) se(7) ///
          keep(k w) mtit("OLS+dum" "OWFE" "DK-OLS+dum" "DK_FE" )
          
      * adjust degree of fredom in DK-FE
      qui {
      mat b=e(b)
      mat V=e(V)
      mat V = V * (e(N) - 3) / (e(N) - e(N_g)-2)
      ereturn post b V, dep(n)
      }
      ereturn display
      Code:
      . esttab ols_dum fe dk_ols_dum dk_fe, b(7) se(7) ///
      >         keep(k w) mtit("OLS+dum" "OWFE" "DK-OLS+dum" "DK_FE" )
      
      ----------------------------------------------------------------------------
                            (1)             (2)             (3)             (4)   
                        OLS+dum            OWFE      DK-OLS+dum           DK_FE   
      ----------------------------------------------------------------------------
      k               0.6403675***    0.6403675***    0.6403675***    0.6403675***
                    (0.0201417)     (0.0201417)     (0.0411264)     (0.0382450)   
      
      w              -0.3677740***   -0.3677740***   -0.3677740      -0.3677740   
                    (0.0523227)     (0.0523227)     (0.1785959)     (0.1660832)   
      ----------------------------------------------------------------------------
      N                    1031            1031            1031            1031   
      ----------------------------------------------------------------------------
      Standard errors in parentheses
      * p<0.05, ** p<0.01, *** p<0.001
      
      .         
      . * adjust degree of fredom in DK-FE
      . qui {
      
      . ereturn display
      ------------------------------------------------------------------------------
                 n | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
                 k |   .6403675   .0411264    15.57   0.000     .5597613    .7209737
                 w |   -.367774   .1785959    -2.06   0.039    -.7178156   -.0177325
             _cons |   2.494684   .5558052     4.49   0.000     1.405325    3.584042
      ------------------------------------------------------------------------------
      Manh Hoang-Ba,
      Facebook,
      Eureka! Uni - YouTube,
      ManhHB94 (Manh Hoang Ba),
      Hoàng Bá Mạnh – Kinh tế lượng: Lý thuyết và ứng dụng

      Comment

      Working...
      X