I am working on a first-difference (FD) estimator for panel data (only two time periods).
I calculated manually the first difference of each variable (dependent and two regressors) and then run an OLS on the first-differenced model:
mydata$l_y <- Lag(mydata$y, -1)
mydata$l_x1 <- Lag(mydata$x1, -1)
mydata$l_x2 <- Lag(mydata$x2, -1)
mydata$delta_y <- mydata$y - mydata$l_y
mydata$delta_x1 <- mydata$x1 - mydata$l_x1
mydata$delta_x2 <- mydata$x2 - mydata$l_x2
fd1 <- lm(delta_y ~ 0 + delta_x1 + delta_x2, data = mydata)
coeftest(fd1, vcov=vcovHC(fd1, type="HC0"))
Then I run the FD estimation from the plm package on R but got completely different results:
fd2 <- plm(y ~ 0 + x1 + x2, data = mydata, model="fd")
coeftest(fd2, vcov=vcovHC(fd2, type="HC0"))
I am struggling to understand why the estimates are different. Any tips would be much appreciated.