First, commenting on -egen-.
It strikes me that any program would have to work hard to cope with
the difference between (e.g.)
1. invocations of -min()-, -max()-, -sum()- and -egen-'s functions
-min()-, -max()-, -sum()- (the latter now undocumented, but still
works)
2. any similar clashes between Stata function names and user-written
-egen- function names (nothing rules them out)
These clashes might not arise often -- but they are certainly
possible. When they happened they could be hard to spot and could
have very bad consequences, notably that valuable data were destroyed.
As we all know, the whole point of separating -generate- and -replace-
is to support data integrity. What StataCorp (CRC, historically) split
asunder cannot easily be re-united.
So, a way forward might be to make -somenewname- a prefix command
somenewname: gen ....
somenewname: replace
somenewname: egen
so that any such statement would trigger -note- production as a
side-effect for the variable being produced or changed.
2. Commenting on -by:-
I haven't tried, but that sounds soluble.
Nick
On Wed, Jan 30, 2013 at 1:17 PM, Richard Goldstein
<richgold@ix.netcom.com> wrote:
> a big (to me) caveat to the -defv- solution (and also to Maarten Buis'
> solution from today): it does not work with -egen- and it does not work
> with -by-
>
> I support request #1
>
> Rich
>
> On 1/30/13 4:04 AM, Nick Cox wrote:
>> #1 was implemented as a user-written -defv- in 1997:
>>
>> STB-51 dm50.1 . . . . . . . . . . . . . . . . . . . . . . . . Update to defv
>> (help defv if installed) . . . . . . . . . . . . . . . J. R. Gleason
>> 9/99 p.2; STB Reprints Vol 9, pp.14--15
>> updated to Stata 6 and improved
>>
>> STB-40 dm50 . . . . . . . Defining variables and recording their definitions
>> (help defv if installed) . . . . . . . . . . . . . . . J. R. Gleason
>> 11/97 pp.9--10; STB Reprints Vol 7, pp.48--49
>> command to define a variable and document the operation it performs
>>
>> Nick
>>
>> On Wed, Jan 30, 2013 at 6:23 AM, Chamara Anuranga <kcanuranga@gmail.com> wrote:
>>
>>> 1. I prefer when generate or replace variable on the dataset the
>>> command attach as a different type of note to the dataset. This option
>>> should be set off and on in order to reduce the file size.
*
* 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/