*==============================================================================* * Advanced Applied Econometrics * Jakub Muck * Exercise 17 * importing data clear all use http://e-web.sgh.waw.pl/jmuck/AAE/Datasets/InternationalTradePoland.dta * data preperation gen im_pl=ln(IM_PL) gen ex_pl=ln(EX_PL) gen dd_pl=ln(DD_PL) gen dd_eu=ln(DD_EU) gen reer=ln(REER) *(ii) estimated demand on imported goods reg im_pl dd_pl reer *(iv) estimated demand on exported goods reg ex_pl dd_eu reer *(iv) testing symmetric effect of real achange rate reg3 (import: im_pl dd_pl reer) /// (export: ex_pl dd_eu reer), /// ols endog(im_pl ex_pl) test ([import]reer=-[export]reer) * constrained estimation cons 1 [import]reer=-[export]reer reg3 (import: im_pl dd_pl reer) /// (export: ex_pl dd_eu reer), /// ols endog(im_pl ex_pl) constraints(1) * (x) 2SLS estimation of SEM reg3 (import: im_pl ex_pl dd_pl reer) /// (export: ex_pl im_pl dd_eu reer), /// 2sls endog(im_pl ex_pl) * (xi) Testing symmetric effect test ([import]reer=-[export]reer) * (xii) 3SLS estimation of SEM * Motivating 3SLS -- cross-equation correlation of residuals predict r1,res eq(#1) predict r2,res eq(#2) corr r* * 3SLS estimation reg3 (import: im_pl ex_pl dd_pl reer) /// (export: ex_pl im_pl dd_eu reer), /// 2sls endog(im_pl ex_pl)