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

From |
David Airey <david.airey@Vanderbilt.Edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: re: syntax |

Date |
Sun, 19 Oct 2008 10:37:44 -0500 |

Right, but I wanted syntax varname1 varname2 [if] [in] [, noconstant] so I typed syntax varlist(min=2 max=2 numeric) [if] [in] [, noconstant] tokenize `varlist' local varname1 `1' local varname2 `2'

syntax varlist(min=2 max=2 numeric) [if] [in] [, noconstant] // tokenize `varlist' local varname1 `1' local varname2 `2'

-Dave On Oct 19, 2008, at 10:24 AM, Kit Baum wrote:

< > Dave said I have not used syntax much. When I write the syntax command, syntax varlist(min=2 max=2 numeric) [if] [in] [, noconstant] I find it parses mycommand weight weight2 , constant differently than mycommand weight weight2, constant The top parses `2' to weight2 and the bottom parses `2' to weight2, (includes the comma). Use of tokenize varlist avoids this problem, but is it a long standing feature of syntax to require option commas to be separated by white space? I can't remember being careful about how I type that interactively.Rather than using numbered macros with -syntax-, just use thereturned -varlist-:program dave syntax varlist(min=2 max=2 numeric) [if] [in] [, noCONStant] di " varlist is `varlist'" di " constant is `constant'" end sysuse auto,clear dave price mpg , cons dave price mpg,nocons dave price mpg , nocons Kit Baum, Boston College Economics and DIW Berlin http://ideas.repec.org/e/pba1.html An Introduction to Modern Econometrics Using Stata: http://www.stata-press.com/books/imeus.html * * 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/

* * 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/

**Follow-Ups**:**RE: st: re: syntax***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**st: re: syntax***From:*Kit Baum <kitbaum@mac.com>

- Prev by Date:
**st: RE: re: syntax** - Next by Date:
**RE: st: twoway scatter ..., yscale(log) with axis on log and arithmetic scales** - Previous by thread:
**st: re: syntax** - Next by thread:
**RE: st: re: syntax** - Index(es):

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