Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: AW: RE: Syntax forvalues in Stata 11 SE


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: AW: RE: Syntax forvalues in Stata 11 SE
Date   Thu, 23 Sep 2010 13:27:42 +0100

I don't know. But as Gauri's code seem to flip randomly in terms of different quote characters, I wonder whether he/she has different versions of supposedly the same code which are being sent in different posts. 

Nick 
[email protected] 

Martin Weiss

" The most obvious problem is the line..."

Bu would this lead to an "invalid syntax" error?

Nick Cox

The most obvious problem is the line 

    use "'allsvys'", clear

in which the ' character should be `. 

Gauri Khanna

I am a new user to the Stata 11.1 SE 

I have run into syntax problems with the - forvalues- command while creating
a loop. 

My syntax which comes from Stata 9 is the following:

forvalues svy = 1/`max1' { 
    use "'allsvys'", clear
    keep if i==`svy'
}

and I get the following error : 

invalid syntax
r(198);

Subsequently, i would also like to run the following syntax (shortened for
convenience)

foreach x of local names {
        if "`x'"=="lgsmkc" {        
            display "`x'"
            gen row`j'=lgcigc 
            local j=`j'+1
        }
}


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index