Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Forvalues, syntax error


From   Phil Schumm <pschumm@uchicago.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Forvalues, syntax error
Date   Thu, 5 Jul 2007 09:28:13 -0500

On Jul 5, 2007, at 9:13 AM, Gauri Khanna wrote:
summarize i
local max1=r(max)
<snip>

forvalues svy = 1/`max1' {
THIS IS THE ERROR I GET
- forvalues svy = 1/`max1' {
= forvalues svy = 1/. {
invalid syntax
r(198);

The problem is that 1/. is not a valid numeric range. The local macro max1 contains "." because your variable i is always missing, and therefore r(max) is not returned.


-- Phil

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