Announcement

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

  • Two-way fixed effects in unbalanced panel

    Hi everyone,

    I am replicating a paper in an economic journal which uses an unbalanced panel of firms over 10 year period. The main specification in the paper is a two-way fixed effects model with firm and year fixed effects. Usually, I think the model would be straightforward as I either could use -xtreg- control for i.year, or -reghdfe- with a(firm year) option. However, the author estimate this simple model this way:

    1. First, they demeaned the model by(firm)
    2. Then they estimate the already demeaned model using reg and control for dummy i.year

    This is strange to me because I always thought that the authors' approach is only equivalent to the first one when the panel is balanced. Indeed, I compare the two approaches and they come up with totally different results. The author didn't explain why they did this in the paper but this is what they did in their published code. I think their approach is inappropriate but couldn't figure out why the authors did that. In another specification, they use IV for their model but they implemented the same way and use -ivregress- in the second step. I use -xtivreg- and -reghdfe- to come up with different results from them.

    I would appreciate your thoughts on these two approach. Thanks a lot. Sample code of two approach is attached.

    Authors' code
    HTML Code:
    for var tfp* mum1 ltar_* lmaxt_* YY* logy logl logx SOE PRI share outputr: egen MX=mean(X), by(firm)
    for var tfp* mum1 ltar_* lmaxt_* YY* logy logl logx SOE PRI:  gen DX=X-MX
    
    for var tfpA mum1: xi: ivregress 2sls DX (Dltar_* = Dlmaxt_*) i.year , cluster(ccyy) \ estimates store FE1_X
    My code
    HTML Code:
    for var tfpA mum1: reghdfe DX (Dltar_* = Dlmaxt_*), a(firm year) vce(cluster firm ccyy)
    Last edited by Mark Pham; 11 Apr 2019, 16:47.

  • #2
    Mark:
    interested listers cannot have any idea of the paper you refer to, as (depite FAQ recommendation) you do not provide full reference.
    Besides, the most relevant source for easing your doubts are Authors: why not email the corresponding one?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X