Dear Statalist,
I want to estimate using GMM predicted Y value for each year and each country in a panel dataset
I used the following code to loop it through each country and each year using xtabond2
Code:
program define Regression_GMM xtset companyid year_ xtabond2 Y L.Y X1 X2 i.indstry , /// gmm(L.Y X1 X2, collapse) iv( i.indstry, /// equation(level)) /// two small if _rc==0 { predict yhat_GMM, xb } end runby Regression_GMM, by(nation year_) verbose
HTML Code:
No observations. panel variable: companyid (strongly balanced) time variable: year_, 2001 to 2001 delta: 1 unit
But when I run this manually for each country/year for selected country/year it runs with no problem
and give me an output
Code:
xtset companyid year_ xtabond2 Y L.Y X1 X2 i.indstry if nation == "country" & year == y1, /// gmm(L.Y X1 X2, collapse) iv( i.indstry, /// equation(level)) /// two small
1) How to run Y L.Y X1 X2 i.indstry regression with GMM/xtabond2
2) How to loop it through each country/year without an issue
Further, I asked this looping question in an earlier post and now I want to extend this to GMM/xtabond2
Previous Post:
https://www.statalist.org/forums/for...-panel-dataset
0 Response to Running regression each country/year using GMM with xtabond2
Post a Comment