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: Program def syntax


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Program def syntax
Date   Tue, 25 Feb 2014 11:03:18 +0000

Making a program -byable- and allowing a -by()- option are, or more
precisely may be, quite different things.

A -by()- option can be anything you want to call such, but most
typically indicates a grouping variable, either essential or optional.
In some cases a -by()- option defines part of the problem, as in
(e.g.) -ranksum-. In other cases, it is an optional calculation, e.g.
adding a -by()- option to a graph command often produces the same kind
of graph for different groups in different panels.

A byable program repeats similar stuff on different data.

In some cases the two syntaxes coexist. For example, various -egen-
functions allow both -by()- options, typically now undocumented, and a
-by:- prefix. Old-timers often still like to trot out the old syntax,
which doesn't require sorting, as the function does it for you.

Nick
[email protected]


On 25 February 2014 10:39, daniel klein <[email protected]> wrote:
> Johannes,
>
> also note that the usual way to make a program allow -by- is to define
> it -byable-  (see -help program-, -help byprog- and the Remarks
> section in pdf manual for the latter).
>
> Best
> Daniel
>
> --
> I got a small question regarding the program define syntax. I defined
> a program and set its syntax to
>
> syntax varlist [, BY(varlist) MOreoff]
>
> [...]
*
*   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