--- Lena Lindahl wrote:
> Has anyone encountered the problem that STATA stops in the middle of a
> bootstrap process, without any error message, everything just stops
> after 5-15 iterations and nothing happens. The end of the result file
>
> This is my bootstrap do-file (I am bootstraping standard errors of a
> correlation):
>
> cap program drop bs_rho_se
> program bs_rho_se, rclass
> xtmixed lnincome || school:||lopnr:, emiterate(10)
> local var_u exp([lns1_1_1]_b[_cons])^2
> local var_e exp([lns2_1_1]_b[_cons])^2
> nlcom `var_u'/(`var_u'+`var_e')
> ret list
> tempname V
> mat `V' = r(V)
> return scalar rho_se = sqrt(`V'[1,1])
> end
> use "C:\grunddata4.dta", clear
> bootstrap rho_se = r(rho_se):bs_rho_se
My guess is that -xtmixed- gets into trouble in some of the bootstrap
samples and is just taking very long to converge. One way to find out
if this is the case is to add the option noisily to the bootstrap
command: -bootstrap rho_se = r(rho_se), noisily :bs_rho_se-.
What I expect to find is that under the heading "Performing
gradient-based optimization:" you will find many iterations. This means
that the EM optimization hasn't sufficiently converged yet for the
gradient-based optimization to work properly. If that is the case you
can solve that by increasing the number of EM iterations: emiterate(20)
for instance, and decrease the number of iterations in the
gradient-based optimization, by specifying the iterate options, e.g.
iterate(10). This may lead to some of the bootstrap samples to fail, but
that is not uncommon for these types of models.
However before you start playing with the emiterate and iterate options
I would diagnose the problem first, by specifying the noisily option in
the -bootstrap- command.
Hope this helps,
Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/