Statalist The Stata Listserver


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

RE: st: RE: Stata functions


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Stata functions
Date   Tue, 24 Jan 2006 12:31:04 -0000

Naturally I agree that it is easier for 
the user not to insert commas when typing 
this command. 

The larger issue is consistency across
several functions. If some functions 
took comma-separated lists and some
took space-separated lists then that 
would be capricious beyond acceptability
and would, in total, cause more user 
grief. That's my surmise based on my 
use and study of Stata. And, as said, 
allowing both syntaxes for 
individual functions would be a source of
horrible bugs. 

I would say that your wish has already
been granted to the extent possible, by
various -egen- functions. Like you I have often 
wanted to do something like 

... if !missing(<varlist>) 

on the fly, but it's, I guess, necessary given
other Stata thinking to do
this in a more long-winded way. 

StataCorp may wish to say more. 

Nick 
n.j.cox@durham.ac.uk 

Fred Wolfe

> >I suspect that this was decided as the
> >convention a long time ago and Stata
> >has stuck to it since.
> >
> >There is at least one very good reason, however.
> >
> >You are thinking of functions for which the
> >arguments in practice are always lists of variables, but
> >syntactically there is nothing to stop you typing
> >other stuff, say,
> >
> ><snip>
> 
> Actually, I don't want any of the other stuff, I just to work 
> with a varlist.
> 
> While it is simple to put in commas with a program, its 
> awkward to work 
> with local macros and return lists with interactive Stata 
> commands (You 
> could use globals, I guess). So the easiest thing would be to allow 
> varlists in selected functions (wish list for Stata 10).
> 
> In addition, occasionally in programming one might want to fill in a 
> function. Its MUCH easier to do this with a varlist than by 
> filling in commas.

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



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