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

From |
Maarten buis <maartenbuis@yahoo.co.uk> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Beware of Stata's Syntax |

Date |
Fri, 23 May 2008 09:27:23 +0100 (BST) |

--- Sergiy Radyakin <serjradyakin@gmail.com> wrote: > Thank you Austin.It follows that by default -syntax- will add an > additional option (varlist=* max=1) which renders -syntax- > inoperable. > This makes it a poor choice for defaults, since most users probably > work with datasets with more than one variable. And it makes even > less > sense when "varname" is in [ ]. > > As for the documentation , I thought when I type > > StataBug x y z, option1(value1) > > this would be exactly the line that is going to the parser, and after > that x y and z are put to the -varlist-. > > > So that if I type > StataBug ,option1(value1) > > and StataBug contains > syntax [varname], option1(string) > > Stata converts the string to be parsed into: > "[varlist min=0 max=1], option1(string)" > > substitutes from what I have typed: > "[min=0 max=1], option1("value1")" > > evaluates, must result in OK, because 0 is between 0 and 1 > > then fills in varlist with the variable names (if specified) or all > variable names (if not specified) and let's the program go. > > Adding * to varlist and adding (max=1) should be mutually exclusive, > since together they will fail most of the time. > > Best wishes, > Sergiy > > > > > > > On 5/22/08, Austin Nichols <austinnichols@gmail.com> wrote: > > Sergiy Radyakin <serjradyakin@gmail.com> et al. -- > > > > Beware of posts with the word "bug" as they usually describe a > > misunderstood feature. > > > > help syntax##description_of_varlist > > > > documents that > > > > The default is to fill [varlist] in with all the variables. If > > default=none is specified, it is left empty. > > > > Since > > Typing varname > > is equivalent to typing varlist(max=1). > > > > using either > > > > syntax [varname (default=none)] > > > > or > > > > syntax varname > > > > is safest. > > > > On Thu, May 22, 2008 at 5:17 PM, Sergiy Radyakin > <serjradyakin@gmail.com> wrote: > > > Dear All, > > > > > > I wonder if this is an intended behaviour (quite dangerous from > my > > > point of view) or just a bug? > > > > > > // --- Begin of file SyntaxBug.do --- > > > > > > program drop _all > > > drop _all > > > > > > generate VariableThatShouldNotBeUsed=. > > > > > > program define SyntaxBug > > > syntax [varname] > > > di `"`varlist'"' > > > end > > > > > > SyntaxBug > > > > > > generate JustAnotherVariable=. > > > > > > SyntaxBug > > > > > > // --- End of file SyntaxBug.do --- > > > > > > If this is not an intended behaviour then it is actually two bugs > in > > > one, since under some conditions the program will process the > variable > > > that the user DID NOT specify (first call in the program above), > and > > > under other conditions it will refuse to work though it > supposedly > > > should (second call in the program above). > > > > > > If this is intended (may be there is an explanation) then it goes > > > against the documentation, saying anything in [ ] is optional. > > > > > > Thank you, > > > Sergiy Radyakin > > * > > * 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/ > > > * > * 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/ > ----------------------------------------- Maarten L. Buis Department of Social Research Methodology Vrije Universiteit Amsterdam Boelelaan 1081 1081 HV Amsterdam The Netherlands visiting address: Buitenveldertselaan 3 (Metropolitan), room Z434 +31 20 5986715 http://home.fsw.vu.nl/m.buis/ ----------------------------------------- __________________________________________________________ Sent from Yahoo! Mail. A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html * * 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/

**References**:**Re: st: Beware of Stata's Syntax***From:*"Sergiy Radyakin" <serjradyakin@gmail.com>

- Prev by Date:
**st: omit output of some coefficients with outreg2** - Next by Date:
**st: missing p-value from t-test** - Previous by thread:
**Re: st: Beware of Stata's Syntax** - Next by thread:
**RE: st: Beware of Stata's Syntax** - Index(es):

© Copyright 1996–2023 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |