This thread is a follow up to the problem described in this post ,
I am on Stata/IC 14.2 for Windows (64-bit x86-64) with Revision 29 Jan 2018.
The option "osample" in the tab "Advanced" is not processed by the dialog box for the command teffects when selecting/using "Nearest neighbour matching" as the estimator.
According to the help file of teffects, the option "osample" is supported by this estimator. In fact, calling teffects nnmatch something, osample(varname) does not give an error on the command line.
The lines below are taken from the official teffects.dlg and show where the call to set the option is forgotten. The problem is in the program adv_output which is in lines 1155 to 1611. I omitted the comments in the code and try to highlight the problem.
If you look at the code, then you see that for all other estimators there is a line optionarg adv.ed_osample, which is missing for nnmatch.
To reproduce just use any dataset and try to use the "osample" option for teffects nnmatch in the dialog box. The command will be sent but without the said option.
If needed, I could provide a walk-through of the dialog box code from where the edit field of the option is defined until the actual command gets issued.
I found the same missing line also in Stata 13. I don't have Stata 15, but looking at whatsnew file for Stata 15 I did not see this missing line fixed.
PS: Forgive for the formatting, I did not see any guidelines how to highlight things in a post.
Edit: Minor spelling mistakes corrected and information about other Stata versions added.
I am on Stata/IC 14.2 for Windows (64-bit x86-64) with Revision 29 Jan 2018.
The option "osample" in the tab "Advanced" is not processed by the dialog box for the command teffects when selecting/using "Nearest neighbour matching" as the estimator.
According to the help file of teffects, the option "osample" is supported by this estimator. In fact, calling teffects nnmatch something, osample(varname) does not give an error on the command line.
The lines below are taken from the official teffects.dlg and show where the call to set the option is forgotten. The problem is in the program adv_output which is in lines 1155 to 1611. I omitted the comments in the code and try to highlight the problem.
If you look at the code, then you see that for all other estimators there is a line optionarg adv.ed_osample, which is missing for nnmatch.
Code:
PROGRAM adv_output BEGIN if model.cb_est.iseq("ra") | model.cb_est.iseq("ipw") | /// model.cb_est.iseq("ipwra") | model.cb_est.iseq("aipw") { optionarg /hidedefault adv.ed_tol optionarg adv.ed_ctrl optionarg adv.ed_lvl optionarg adv.ed_osample } if model.cb_est.iseq("nnmatch") { optionarg adv.ed_cal optionarg /hidedefault adv.ed_dtol optionarg /hidedefault adv.ed_pstol optionarg adv.ed_stub optionarg adv.ed_ctrl_ps optionarg adv.ed_lvl_ps HERE MISSING optionarg adv.ed_osample if adv.ck_metric { put "metric(" if adv.rb_mah { put "mahalanobis" } if adv.rb_iva { put "ivariance" } if adv.rb_euc { put "euclidean" } if adv.rb_user { put "matrix " require adv.cb_user put adv.cb_user } put ")" } } if model.cb_est.iseq("psmatch") { optionarg adv.ed_cal optionarg /hidedefault adv.ed_pstol optionarg adv.ed_stub optionarg adv.ed_ctrl_ps optionarg adv.ed_lvl_ps optionarg adv.ed_osample } END
If needed, I could provide a walk-through of the dialog box code from where the edit field of the option is defined until the actual command gets issued.
I found the same missing line also in Stata 13. I don't have Stata 15, but looking at whatsnew file for Stata 15 I did not see this missing line fixed.
PS: Forgive for the formatting, I did not see any guidelines how to highlight things in a post.
Edit: Minor spelling mistakes corrected and information about other Stata versions added.
Comment