Statalist


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

Re: st: Replace a loop with the help of simulate?


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: Replace a loop with the help of simulate?
Date   Tue, 2 Oct 2007 17:55:35 -0400

See
http://www.stata.com/statalist/archive/2006-11/msg00918.html
and don't -set seed- inside a loop under any circumstances--you will
no longer have suitable randomness.

On 10/2/07, Johannes Eggs <[email protected]> wrote:
> Hi,
> is there a possibility to replace the following loops with the help of
> the simulate or some other command. The loops are working, but I would
> like to have one dataset not a 100.
>
> local i = 100
>
> while `i' > 0 {
> set seed `i'
> use data.dta
> bsample
> xtmixed y x1-Xn || L:
> predict b, rstandard
> collapse b z, by(L)
> save no`i'.dta
>   local i= `i' -1
>   }
>
> local i = 100
> while `i' > 1{
>
> append using no`i'.dta
>   local i= `i' -1
>   }
>
> Thanks in Advance
> J.Eggs
>
>
> *
> *   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index