Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: capture number of -xtmixed- iterations?


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: capture number of -xtmixed- iterations?
Date   Wed, 26 Dec 2007 20:25:37 -0500

Nice tip. Thanks.

Jeph

Yulia Marchenko, StataCorp wrote:
I'd like to add two small corrections below to my previous posting:

http://www.stata.com/statalist/archive/2007-12/msg00650.html

1) The number of iterations is not saved after -xtmixed- BUT is saved after
most -ml- commands in -e(ic)-.

2) Saving the convergence flag in return results is unnecessary, you can
simply use -e(converged)- as an expression in -simulate-:

/******************************************************/
cap program drop mywrapper
program mywrapper
	version 10
	clear
	set obs 10
	gen double id = _n
	gen double y = 2*invnormal(uniform())
	expand 5
	replace y = 5 + y + invnormal(uniform())
	xtmixed y || id: , iter(3)
end

simulate (e:conv = e(converged)) _b, reps(3): mywrapper
qui summ  e_conv
di as txt "# converged: " as res r(N)
/******************************************************/

--Yulia
ymarchenko@stata.com

*
*   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/

*
*   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/



© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index