I am trying to estimate a system GMM equation on a sample capital structure data, which I have unabled open access on google drive. I simply load the data, eliminate "NAs", make it pdata.frame then run the below code.
Packages I use are : plm and dplyr
the code for data prep is
library(plm)
library(dplyr)
load the data, and make it panel data
practice_data=pdata.frame(na.omit(practice_data), index=c("year", "id"))#make it panel data
pgmm(debt_r~lag(debt_r,1)+tangible_r+ownfund+lnsize+profitability|lag(debt_r, 2:10), model="twosteps", effect = "twoways", transformation = "ld", data=practice_data) #run the regression
practice_data_over_10=practice_data%>%group_by(id)%>%filter(n()>=10)
pgmm(debt_r~lag(debt_r,1)+tangible_r+ownfund+lnsize+profitability|lag(debt_r, 2:10), model="twosteps", effect = "twoways", transformation = "ld", data=practice_data_over_10)
I made sure all the units in panel has more than 10 year data points so GMM requirement is satisfied. No matter what I do I keep getting the same error in everytime. I provide the link to the data set. I'd appreciate if yu guys tell me how to fix it
https://drive.google.com/open?id=1o_Fvy6089MRh5OMGudzvabF-LRljPws_