--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
--- On Tue, 20/10/09, Martin Weiss wrote:
> " Can I ask, what does the code "local m= r(max)" and
> "forvalues j = 1/`m' "
> mean in that command?"
>
>
>
> Yes, you can. The first one stores the maximum calculated
> by the line -sum _mj, meanonly- in a -local- macro so as
> to make it accessible after other commands have
> overwritten the returned values of the -summarize- command.
> The second one lets Stata loop from a fixed starting point
> of "1" to this very maximum stored by the -local- in "m",
> in increments of 1...
That is correct. To expand a bit on that in the context of
-ice-: _mj identifies each imputed dataset, where _mj=0
represents the original dataset with missing values, _mj=1
the first imputed dataset, _mj=2 the second, etc. So, the
maximum of _mj represents the total number of imputed
datasets. In the loop I loop over the imputed datasets,
calculate the regression in each of them, and add up the
log(r2). After the loop I divide by the number of imputed
datasets (still stored in the local `m') and exponentiate
it again.
-- Maarten
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/