Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

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

From   Nick Cox <>
To   "''" <>
Subject   st: RE: RE: Syntax forvalues in Stata 11 SE
Date   Thu, 23 Sep 2010 13:05:57 +0100

... meaning the first such character. 


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

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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index