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]

Re: st: Invalid Syntax


From   Richard Goldstein <[email protected]>
To   [email protected]
Subject   Re: st: Invalid Syntax
Date   Mon, 11 Nov 2013 10:43:51 -0500

there are two syntaxes for -drop-: one drops variables and does not
allow "if"; the other drops observations and does allow "if"; so you are
trying to drop variables but use "if"; see -h drop-

Rich

On 11/11/13, 10:36 AM, Amir Sadeghi Emamgholi wrote:
> Hello Statalisters,
> 
> Sorry for this stupid question. I cannot figure out the problem with
> my drop command in the following loop. When I run it I get the -
> Invalid Syntax - error message.
> 
> The loop:
> 
> foreach i in E_I3 E_I4 E_I5 E_I6 E_I7 E_I8 E_I9 E_I10 E_I11 {
>       qui summ `i'
>       drop `i' if r(N) == 0
> }
> 
> Thanks!
> Amirsa
> 
> P.S. when I use - drop "`i'" if r(N) == 0 - I get the - "E_I3 invalid
> name - error message.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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