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

st: Re: evaluating an expression in -forvalues-

From   "Richard Upward" <>
To   <>
Subject   st: Re: evaluating an expression in -forvalues-
Date   Wed, 17 Dec 2003 09:25:45 +0000

As usual, thanks to Nick for his help with this.  I think I need a 
"how to find what you want in those manuals" course.
The answer was on page 230 in [P].  I was looking in [U] 21.3.


Nick Cox wrote:

You can get evaluation on the fly with `=exp' 
where "exp" is an expression to be evaluated. 
That expression can itself include local macros.

forval i = 1(1)`=`t'+2' { 


forval i = 1/`=`t'+2' { 

Note that this is nothing to do with -forvalues- 
as such. It is a general device for handling 
macro evaluation, added in Stata 7 (but not documented) 
and documented in Stata 8. For example, start at the 
on-line help for -macro-. 

There was also related discussion within SJ 3(2):185--202

Richard Upward
School of Economics
University of Nottingham
University Park
Nottingham NG7 2RD
Tel: +44 (0) 115 95 14735

*   For searches and help try:

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