Hello all,

I have panel data on 16 countries for the years 1995 to 2007 (yearly observations). Initially, I wanted to use a fixed-effects model including both country- and time-fixed effects and to instrument x with z. I obtained my results with the following code:

Code:
    xtset country year
    xi: xtivreg y (x=z) i.year, fe vce(cluster country)
However, I detected that there is a strong serial correlation in the error terms, using the following commands:

Code:
    predict uhat
    reg uhat l.uhat
Therefore, using a stacked first-differences model is preferred to a fixed-effects model according to the literature.

I generated the differences with the following code:

Code:
    bysort country: gen x_diff = x[_n]- x[_n-1]
    bysort country: gen z_diff= z[_n]- z[_n-1]
    bysort country: gen y_diff = y[_n]- y[_n-1]
How do I now estimate the stacked first-differences model, maintaining the IV approach? I want to include time dummies and add country-fixed effects to the FD-model. I have been told that country-fixed effects in an FD-model capture different time trends across countries. Finally, I want to add an intercept since Woolridge recommends adding an intercept in the first-differenced equation if the time intercepts are not of direct interest.

Your help is greatly appreciated!