Dear Clyde,
Thank you so much for going this extra mile. Here are some proposed estimators which is abit close to yours. They are found on http://ftp.iza.org/dp7359.pdf . Equation (21) on page 9 and equation (31) on page 12. Here are the associated
Thank you so much for going this extra mile. Here are some proposed estimators which is abit close to yours. They are found on http://ftp.iza.org/dp7359.pdf . Equation (21) on page 9 and equation (31) on page 12. Here are the associated
Code:
*QD-GMM gmm (y-((1-{g}^(gap+lgap))/(1-({g}^lgap)))*ly+((({g}^lgap)-{g}^(gap+lgap))/(1-({g}^lgap)))*l2y - {b}*(x-((1-({g}^gap))/(1-({g}^lgap)))*lx) ), instruments(x lx l2y, noconstant) onestep ret sca qdgmm_us_g = _b[/g] ret sca qdgmm_us_b = _b[/b] *E-NLS-IV bys ivar: g runsum_ly = sum(ly) gen yb_bar = runsum_ly/m gen x_demean = x - xm reg ly yb_bar predict res, r reg ly res x_demean predict lyhat reg x res x_demean predict xhat cap nl (y = lyhat*({g=`gam'}^gap) + {b=`beta'}*xhat) if m > 0, iter(500) nolog if e(converge) == 0 | _rc != 0 { ret sca enlsiv_g = . ret sca enlsiv_b = . } else { ret sca enlsiv_g = _b[/g] ret sca enlsiv_b = _b[/b] } drop lyhat xhat yb_bar runsum_ly *E-NLS-CRE-IV reg ly res x xm predict lyhat cap nl (y = lyhat*({g=`gam'}^gap) + {b=`beta'}*x + {d}*xm*((1-({g}^gap))/(1-{g}))) if m > 0, iter(500) nolog if e(converge) == 0 | _rc != 0 { ret sca enlscreiv_g = . ret sca enlscreiv_b = . } else { ret sca enlscreiv_g = _b[/g] ret sca enlscreiv_b = _b[/b] } drop lyhat
Comment