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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Syntax error with Syntax itself


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Syntax error with Syntax itself
Date   Wed, 8 Aug 2012 21:34:00 +0100

-breaks()- requires an integer argument but is not compulsory. It
therefore requires a default.

-goodliq()- is said to take a numeric argument, but that keyword is
not allowed by itself.

All documented.

Nick

On Wed, Aug 8, 2012 at 9:21 PM, Pradipto Banerjee
<pradipto.banerjee@adainvestments.com> wrote:
> Hi, I am writing an egen function
>
> program define _gmakesigwgt
> version 9.2
> gettoken type 0 : 0
> gettoken g      0 : 0
> gettoken eqs 0 : 0
> syntax varlist (min=2) [, BY(string) BReaks(integer) GOODliq(numeric)]
> .
> .
> .
> end
>
>
> I've been debugging it using set trace on (set tracedepth 2). I tried calling it as
>
> . egen var2 = makesigwgt (var1 var2 var3), by(var4)
>
> The debug shows me that there is an -error 197-, i.e. error with the syntax statement itself. The exact error output is:
>
> - syntax varlist (min=2) [, BY(string) BReaks(integer) GOODliq(numeric)]
> invalid syntax
> r(197)
>
>
> I can't understand what might be the error. Can someone give any suggestions?
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index