Dear Stata list,
I am running a user-written program through -bootstrap-, but strangely enough it only works if I include the noisily or trace options.
The setup is something like this:
The contents of the program to be bootstrapped is somewhat involved, but basically in runs a few -regress- and -margins- commands and posts some computed statistics into e(b).
Everything seems to work as intended when passing noisily or trace to -bootstrap-, but without those commands, _b is returned as missing in each iteration (confirmed using the saving() option, the resulting file in that case contains only missing values).
I am puzzled how I should even debug this, since the only way to debug is using trace, but then everything seems to work.
I'd be grateful for any hints. (I am running Stata 14.1, latest updates)
Thanks,
Richard
I am running a user-written program through -bootstrap-, but strangely enough it only works if I include the noisily or trace options.
The setup is something like this:
Code:
program define moments_age_resid, eclass syntax [in] [if] [pweight/], agelist(numlist sort integer) .... ereturn post b, esample(`touse') end bootstrap, reps(10) cluster(hhidpn) strata(age_strat): moments_age_resid, agelist(`age_levels')
Everything seems to work as intended when passing noisily or trace to -bootstrap-, but without those commands, _b is returned as missing in each iteration (confirmed using the saving() option, the resulting file in that case contains only missing values).
I am puzzled how I should even debug this, since the only way to debug is using trace, but then everything seems to work.
I'd be grateful for any hints. (I am running Stata 14.1, latest updates)
Thanks,
Richard