1

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_

krkc_bhdr
  • 61
  • 4
  • This is the message I get: 'Error in cbind(yX1[[i]], V1) : number of rows of matrices must match (see arg 2) In addition: There were 21 warnings (use warnings() to see them)' – krkc_bhdr Jul 19 '18 at 18:25
  • Post code that loads needed libraries and does the data prep. – IRTFM Jul 19 '18 at 18:26
  • 1
    Learn to use [edit]. Do not use comments to modify question. I'm pretty sure that you did some sort of data_entry on that xlsx file. – IRTFM Jul 19 '18 at 18:32
  • above editted should help, – krkc_bhdr Jul 19 '18 at 18:46
  • 1
    You are the one who is asking for "help" and you are not paying close attention to the advice you are being given. There is still no unambiguous path from an xlsx file to the practice_data object. – IRTFM Jul 19 '18 at 19:12
  • I truly appreciate the help, bu I don't quite understand why you think that way. I've editted my question as you suggested and posted the prep code. Maybe I am missing something? – krkc_bhdr Jul 19 '18 at 19:50

0 Answers0