/* spregdpd *! VERSION 2.0 03/03/2013 */ VERSION 11.0 INCLUDE _std_xlarge DEFINE _dlght 450 INCLUDE header HELP hlp1, view("help spregdpd") RESET res1 SCRIPT PREINIT BEGIN program parseMessage script se_createAsSvyOLS script se_setBias_on program svy_check_title END PROGRAM parseMessage BEGIN if __MESSAGE.contains("__MI__") { call script se_setMI_on } END SCRIPT POSTINIT BEGIN program check_bytab program se_setFinalInitState END PROGRAM check_bytab BEGIN if ! __MESSAGE.contains("__MI__") { call script sub_set_by_on } END SCRIPT svy_is_on BEGIN script max_setDefaultNoLog END SCRIPT svy_is_off BEGIN script max_setDefaultLog END DIALOG main, label("spregdpd- Spatial Panel (Lag/Durbin) Arellano-Bond Linear Dynamic Regression") /// tabtitle("Main") BEGIN DEFINE wlabel 130 DEFINE cmdx 320 DEFINE cmdw 170 DEFINE _x _xsetbu DEFINE _y _top TEXT tx_fnm _lft _top 400 ., /// label("Weight Matrix File Name (dta):") TEXT tx_cmd 430 @ 100 ., /// label("# Cross Section:") FILE fi_fnm _lft _ss 400 ., /// label("Brows...") /// option("wmfile") /// filter("Stata dta File (*.dta)|*.dta|All (*.*)|*.*") /// defext(dta) EDIT ed_cmd 430 @ 100 ., /// option("nc") /// label("Cross Section") GROUPBOX gb_group1 _lft _ss _iwd _ht5 , TEXT tx_yvar _ilft +15 _vnwd ., /* */ label("Dependent Variable:") /* */ TEXT tx_xvar _vlx @ _cwd2 ., /* */ label("Independent Variables:") /* */ VARNAME vn_yvar _ilft _ss _vnwd ., /* */ label("Dependent Variable") /* */ VARLIST vl_xvar _vlx @ 380 ., /* */ label("Independent Variables") CHECKBOX ck_nocons @ _ss _cwd1 ., /* */ label("No Constant") /* */ option("noconstant") /* */ GROUPBOX gb_model _lft _ms _iwd _ht1 , /// label("Model:") RADIO rb_ms1 _ilft _ss 300 ., /* */ label("Dynamic Spatial Lag Model") /* */ first /* */ option("model(sar)") /* */ DEFINE y @y RADIO rb_ms2 _ilft2 y 300 ., /* */ label("Dynamic Spatial Durbin Model") /* */ last /* */ option("model(sdm)") /* */ GROUPBOX gb_group3 _lft _ss _iwd _ht10 , VARLIST vl_dgmm _ilft _ss 300 ., /// label("Difference Instruments (xtdpd)") /// option(dgmmiv) TEXT tx_dgmm 330 @ 200 ., /// label("Difference Instruments (xtdpd)") VARLIST vl_inst _ilft _ss 300 ., /// label("Instrumental Vars (xtabond)") /// option(inst) TEXT tx_inst 330 @ 200 ., /// label("Instrumental Vars (xtabond)") */ VARLIST vl_diff _ilft _ss 300 ., /// label("Differenced Vars (xtabond)") /// option(diff) TEXT tx_diff 330 @ 200 ., /// label("Differenced Vars (xtabond)") */ VARLIST vl_endog _ilft _ss 300 ., /// label("Endogenous Vars (xtabond, xtdpdsys)") /// option(endog) TEXT tx_endog 330 @ 200 ., /// label("Endogenous Vars (xtabond, xtdpdsys)") */ VARLIST vl_pre _ilft _ss 300 ., /// label("Predetermined Vars (xtabond, xtdpdsys)") /// option(pre) TEXT tx_pre 330 @ 200 ., /// label("Predetermined Vars (xtabond, xtdpdsys)") */ GROUPBOX gb_meth _lft _ls _ibwd _ht7 , /// label(" Linear Dynamic Panel Data Method") RADIO rb_m1 _ilft _ss 350 ., /* */ label("(xtdhp) Han-Philips") /* */ first /* */ option("run(xtdhp)") /* */ onclickon(script ck_dpd1_on) /* */ RADIO rb_m2 _ilft _ss 350 ., /* */ label("(xtabond) Arellano-Bond") /* */ option("run(xtabond)") /* */ onclickon(script ck_dpd2_on) /* */ RADIO rb_m3 _ilft _ss 350 ., /* */ label("(xtdpd) Arellano-Bond (1991)") /* */ option("run(xtdpd)") /* */ onclickon(script ck_dpd3_on) /* */ RADIO rb_m4 _ilft _ss 350 ., /* */ label("(xtdpdsys) Arellano-Bover/Blundell-Bond (1995,1998) System") /* */ last /* */ option("run(xtdpdsys)") /* */ onclickon(script ck_dpd4_on) /* */ GROUPBOX gb_gmmt _lft _ms _ibwd _ht1 , /// label("Effects Type:") RADIO rb_re _ilft _ss 170 ., /// label("Random-Effects (RE)") /// first /// option(re) RADIO rb_fe _ilft3_2 @ @ ., /// label("Fixed-Effects (FE)") /// option(fe) RADIO rb_be _ilft3_3 @ @ ., /// label("Between-Effects (BE)") /// last /// option(be) */ END DIALOG est1 , tabtitle("Options") BEGIN CHECKBOX ck_model11 _lft _top _ibwd _ht16 , /// groupbox /// onclickon(script ck_model11_on) /// onclickoff(script ck_model11_off) /// label("Options:") CHECKBOX ck_tests _ilft _ss 350 ., option("tests") /* */ label("Display ALL Tests") CHECKBOX ck_lmspac _ilft _ss 350 ., option("lmspac") /* */ label("Spatial Autocorrelation Tests") CHECKBOX ck_diag @ _ss @ ., option("diag") /* */ label("Model Selection Diagnostic Criteria") CHECKBOX ck_lmhet _ilft _ss 350 ., option("lmhet") /* */ label("Heteroscedasticity Tests") CHECKBOX ck_lmnorm _ilft _ss 350 ., option("lmnorm") /* */ label("Non Normality Tests") CHECKBOX ck_twostep _ilft _ss 400 ., option("twostep") /* */ label("twostep: (xtdpd) Two-Step Estimates") CHECKBOX ck_coll _ilft _ss 400 ., option("coll") /* */ label("coll: Keep Collinear Variables") CHECKBOX ck_zero _ilft _ss 400 ., option("zero") /* */ label("zero: Convert Missing Values Observations to Zero") CHECKBOX ck_mfx _lft _xls _ibwd _ht2 , /// groupbox /// onclickon(script ck_mfx_on) /// onclickoff(script ck_mfx_off) /// label("Marginal Effects - Elasticities:") RADIO rb_lin _ilft _ss 120 ., /* */ label("Linear") /* */ first /* */ option("mfx(lin)") /* */ DEFINE y @y RADIO rb_log 130 y 120 ., /* */ label("Log-Log") /* */ last /* */ option("mfx(log)") /* */ CHECKBOX ck_tolog 250 y 120 ., option("tolog") /* */ label("Log Transform Varlist") /* */ CHECKBOX ck_model0 _lft _xls _ibwd _ht5 , /// groupbox /// onclickon(script ck_model0_on) /// onclickoff(script ck_model0_off) /// label("Standardized Weight Matrix Type:") RADIO rb_ws1 _ilft _ss 300 ., /* */ label("Standardized Weight Matrix - (W)") /* */ first /* */ option("stand") /* */ RADIO rb_ws2 _ilft _ss 300 ., /* */ label("Inverse Standardized Weight Matrix - (1/W)") /* */ option("stand inv") /* */ RADIO rb_ws3 _ilft _ss 300 ., /* */ label("Inverse Squared Standardized Weight Matrix - (1/W^2)") /* */ last /* */ option("stand inv2") /* */ CHECKBOX ck_model3 _lft _xls _ibwd _ht4 , /// groupbox /// onclickon(script ck_model31_on) /// onclickoff(script ck_model31_off) /// label("Additional Options:") TEXT tx_predict _ilft _ss 150 ., /// label("Predicted Variable") TEXT tx_resid 200 @ 150 ., /// label("Residuals Variable") VARNAME vn_predict _ilft _ss 150 ., /// label("predict") /// option(predict) VARNAME vn_resid 200 @ 150 ., /// label("resid") /// option(resid) */ END SCRIPT ck_mfx_on BEGIN est1.rb_lin.enable est1.rb_log.enable END SCRIPT ck_mfx_off BEGIN est1.rb_lin.disable est1.rb_log.disable END SCRIPT ck_dpd1_on BEGIN main.rb_re.enable main.rb_fe.enable main.rb_be.enable main.vl_inst.disable main.vl_diff.disable main.vl_endog.disable main.vl_pre.disable main.vl_dgmm.disable END SCRIPT ck_dpd1_off BEGIN main.rb_re.disable main.rb_fe.disable main.rb_be.disable main.vl_inst.disable main.vl_diff.disable main.vl_endog.disable main.vl_pre.disable main.vl_dgmm.disable END SCRIPT ck_dpd2_on BEGIN main.rb_re.disable main.rb_fe.disable main.rb_be.disable main.vl_inst.enable main.vl_diff.enable main.vl_endog.enable main.vl_pre.enable main.vl_dgmm.disable END SCRIPT ck_dpd2_off BEGIN main.rb_re.disable main.rb_fe.disable main.rb_be.disable main.vl_inst.disable main.vl_diff.disable main.vl_endog.disable main.vl_pre.disable main.vl_dgmm.disable END SCRIPT ck_dpd3_on BEGIN main.rb_re.disable main.rb_fe.disable main.rb_be.disable main.vl_inst.disable main.vl_diff.disable main.vl_endog.disable main.vl_pre.disable main.vl_dgmm.enable END SCRIPT ck_dpd3_off BEGIN main.rb_re.disable main.rb_fe.disable main.rb_be.disable main.vl_inst.disable main.vl_diff.disable main.vl_endog.disable main.vl_pre.disable main.vl_dgmm.disable END SCRIPT ck_dpd4_on BEGIN main.rb_re.disable main.rb_fe.disable main.rb_be.disable main.vl_inst.disable main.vl_diff.disable main.vl_endog.enable main.vl_pre.enable main.vl_dgmm.disable END SCRIPT ck_dpd4_off BEGIN main.rb_re.disable main.rb_fe.disable main.rb_be.disable main.vl_inst.disable main.vl_diff.disable main.vl_endog.disable main.vl_pre.disable main.vl_dgmm.disable END SCRIPT ck_model0_on BEGIN est1.rb_ws1.enable est1.rb_ws2.enable est1.rb_ws3.enable END SCRIPT ck_model0_off BEGIN est1.rb_ws1.disable est1.rb_ws2.disable est1.rb_ws3.disable END SCRIPT ck_model11_on BEGIN est1.ck_tests.enable est1.ck_lmspac.enable est1.ck_lmhet.enable est1.ck_lmnorm.enable est1.ck_twostep.enable est1.ck_diag.enable est1.ck_coll.enable est1.ck_zero.enable END SCRIPT ck_model11_off BEGIN est1.ck_lmspac.disable est1.ck_lmhet.disable est1.ck_lmnorm.disable est1.ck_twostep.disable est1.ck_diag.disable est1.ck_tests.disable est1.ck_coll.disable est1.ck_zero.disable END SCRIPT ck_model31_on BEGIN est1.vn_predict.enable est1.vn_resid.enable END SCRIPT ck_model31_off BEGIN est1.vn_predict.disable est1.vn_resid.disable END INCLUDE byifin INCLUDE weights_fpai INCLUDE se PROGRAM command BEGIN put /program by_output put "spregdpd " varlist main.vn_yvar main.vl_xvar put " " /program ifin_output put " " /program weights_output put /program se_prefix_output require main.fi_fnm require main.ed_cmd beginoptions optionarg main.fi_fnm optionarg main.ed_cmd option radio(main rb_ms1 rb_ms2) option radio(main rb_m1 rb_m2 rb_m3 rb_m4) option radio(main rb_re rb_fe rb_be) option radio(est1 rb_ws1 rb_ws2 rb_ws3) option radio(est1 rb_lin rb_log) option est1.ck_tolog option main.ck_nocons optionarg main.vl_dgmm optionarg main.vl_inst optionarg main.vl_diff optionarg main.vl_endog optionarg main.vl_pre option est1.ck_lmspac option est1.ck_lmhet option est1.ck_lmnorm option est1.ck_diag option est1.ck_twostep option est1.ck_tests option est1.ck_coll option est1.ck_zero optionarg est1.vn_predict optionarg est1.vn_resid put " " /program se_output endoptions END