Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: re: while looping


From   xiaotang li <xiaotang_sue_li@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: RE: re: while looping
Date   Wed, 20 Aug 2003 03:51:49 -0700 (PDT)

Thanks a lot for your reply and sorry for bothering
you again. Still I can't work it out. I just don't
know how to run a programe. I write such things like:
prog define Nick
                  display 'Hi there'
                  end

in a do-file and save the do-file, then I type
'do.....' in the command box to do the do-file, is it
right?

Thanks

Xiaotang

--- Nick Cox <n.j.cox@durham.ac.uk> wrote:
> There are two distinct steps: 
> 
> 1. Define the program.
> 
> 2. Run it. 
> 
> Here is another example: 
> 
> . program define xiaotang
>   1. di "Hi there!" 
>   2. end 
> 
> . xiaotang
> Hi there!
> 
> I defined a program called "xiaotang"; 
> then I ran it. (This is possible because there 
> is no official Stata command called -xiaotang-.) 
> 
> See [U] 21 Programming Stata. 
> 
> Nick 
> n.j.cox@durham.ac.uk 
> 
> > -----Original Message-----
> > xiaotang li
> > 
> > Thanks for your kind help. I can simply do the
> > following just by running do "C:\.....\.do" in the
> > command box. But still don't understand how to run
> the
> > program. I define the program in the do-file and
> run
> > it by typing 'do....' in the command box, but
> seems it
> > is not the correct way. I can't find related
> > information in the 'help'.
> > 
> > matrix A = J(3,3,1)
> > 	matrix list A
> > 	forval i = 1/4 { 
> > 		matrix A = 2 * A
> > 		matrix  li A 
> > 	}
> > 
> 
> *
> *   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/


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.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/



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