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" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Replace a loop with the help of simulate?
Date   Tue, 2 Oct 2007 18:03:52 -0400

Or
http://www.stata.com/statalist/archive/2007-03/msg00253.html
or others...

On 10/2/07, Austin Nichols <austinnichols@gmail.com> wrote:
> 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 <Johannes.Eggs@uni-konstanz.de> 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
> >   }
> >
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index