I saw this previous post from 2017 that talks about the same table but only focuses on OLS. I’m also working on replicating Table 8.1 in Baltagi’s Economic Analysis of Panel data book. I can replicate the table in Stata and I can replicate most of the table using the
plm package in R. Unfortunately, I cannot replicate the Arellano-Bond Twostep GMM values. I can confirm that I can get the same results as the Table using Stata but do not get the same results as those in the table using
plm. I am confused what option or technique is causing the issue.
I’ve included the R code here for both the one-step and two-step GMM estimates. As shown, when estimating the one-step, the results match while when estimating the two-step they do not. I’m also including Table 8.1 at the bottom to show the results presented in the book.
library(plm) #Loading the Baltagi dataset provided as part of the plm package data(Cigar) #transforming to real variables as required Cigar$real_c <- with(Cigar, (sales*pop)/pop16) Cigar$real_p <- with(Cigar, (price/cpi)*100) Cigar$real_pimin = with(Cigar, (pimin/cpi)*100) Cigar$real_ndi <- with(Cigar, (ndi/cpi)) gmm_onestep <- pgmm(log(real_c) ~ lag(log(real_c), 1) + log(real_p) + log(real_pimin) + log(real_ndi) | lag(log(real_c), 2:99), data = Cigar, effect = "twoways", model = "onestep") #match w/ Table 8.1: 0.84, -0.377, -0.016, 0.14 round(summary(gmm_onestep)$coef, 3) #Two step does not match Table 8.1: 0.80, -0.379; -0.020, 0.24 gmm_twostep <- pgmm(log(real_c) ~ lag(log(real_c), 1) + log(real_p) + log(real_pimin) + log(real_ndi) | lag(log(real_c), 2:99), data = Cigar, effect = "twoways", model = "twostep") #plm reports 0.632, -0.358, -0.002, 0.386 round(summary(gmm_twostep)$coef, 3)
Any help would be greatly appreciated!