Statalist


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

Re: st: Re: saving memory local vs usual variable


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Re: saving memory local vs usual variable
Date   Fri, 3 Oct 2008 17:56:51 +0100 (BST)

--- Ashim Kapoor <[email protected]> wrote:
> Maybe I should say why I am asking this. It just seems like STRANGE
> to me that the person who programmed stata to work the way it does
> INTENTIONALLY allows us to do :-
> 
> egen x=max(y)
> 
> but does not allow us to do
> 
> local x=max(y).
> 
> It just seems counterintuitive and a waste of memory. Seems unlikely
> that the guy who programmed this did not think of this. That is why I
> think that I am missing something.

That is because -egen- subcommand -max()- has a different syntax than
the -max()- function (see -help max-). Fuctions are much more general
animals than -egen- subcommands in that they can be directly applied in
a variety circumstances, like defining a macro, while -egen- can only
be used for creating a variable. (see -help function-, the User's guide
section 13.3, and -help egen-) 

-- Maarten


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


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



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