Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: loop


From   "Justina Fischer" <JAVFischer@gmx.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: loop
Date   Sat, 13 Oct 2012 10:59:21 +0200

Hi Dimpol,

Muhammad is right, this is in principle quite easy, and you could have found this out with the sources available to you, e.g. by googling 'stata' and 'loop'.

Sometimes people on this list do not answer because they think you can find out yourself.

The typical example is:

forvalues i = 1/10 {

display " `i' "

}


In place of 'display', you can also run a regression or make a graph. 

HTH

Justina





-------- Original-Nachricht --------
> Datum: Fri, 12 Oct 2012 15:58:40 +0500
> Von: Muhammad Anees <anees@aneconomist.com>
> An: statalist@hsphsun2.harvard.edu
> Betreff: Re: st: loop

> Hello,
> 
> I think sending the same message again and again would not give any
> positive response. One question? Have you gone through the FAQs and
> searched the archives of this list? If not, I would recommend
> following a FAQ to do it so you can find some hints before getting
> proper discussions.
> 
> Anees
> 
> On Fri, Oct 12, 2012 at 3:19 PM, - <dimpol7@googlemail.com> wrote:
> > hello all,
> > is there a way to perform regressions repeatedly, i.e. can I set a
> > loop over a regression and execute it for a number of times? What is
> > the code for that in Stata? Of course the data over which the
> > regression is done will change at every repetition, and I have
> > consecutive IDs on the data, so I want to have an number e.g. i =
> > 1,.....,1000 and for each i the new data is read and the regression is
> > performed on them.
> > Is there a way to do the same loop on the respective graphs?
> >
> > Thank you all
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/help.cgi?search
> > *   http://www.stata.com/support/faqs/resources/statalist-faq/
> > *   http://www.ats.ucla.edu/stat/stata/
> 
> 
> 
> -- 
> 
> Best
> ---------------------------
> Muhammad Anees
> Assistant Professor/Programme Coordinator
> COMSATS Institute of Information Technology
> Attock 43600, Pakistan
> http://www.aneconomist.com
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index