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

st: newbie- syntax question


From   "Rio, Martin" <[email protected]>
To   [email protected]
Subject   st: newbie- syntax question
Date   Tue, 26 Aug 2003 12:41:41 -0400

I am writing a code on stata 8 intecooled (win2k), and am running into what
I guess is a syntax problem.
As soon as the code gets to the loop below, it returns :
*yb1 invalid name
r(198);

Te loop is:

while `i' <= `timeunits' {
	scalar factor = 10^(`timeunits' - `i')
	replace string = string+(`factor'*y`i')
	local i = `i' + 1
}

I think the syntax error is in the way I try to multiply each variable (y1,
y2, ..., y`timeunits') by the corresponding factor. The way I am setting it
up seems consistent with other Stata commands that I have used, but I am no
an expert on Stata syntax. I'd appreciate if someone could point out my
error?

Thanks

Mart�n Rio
Charles River Associates
Washington, DC 
phone:	(202) 662-3957
fax:	(202) 662-3910


*
*   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