Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: RE: RE: RE: syntax question


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: RE: RE: syntax question
Date   Tue, 19 Nov 2002 20:49:38 -0000

David Moore

> There's at least one thing you can do with the SAS macro programming
> language that I have found useful.  You can create
> functions.  I know egen
> allows some limited capabilities with respect to new
> variable generation,
> but functions are more general.  For example, they can be
> used to calculate
> or return values in many different programming contexts,
> not just to create
> variables.

True. That is, suppose you wanted to write
a Stata function to calculate logits. You could write
a -egen- function to create new variables, or
you could write -logitf- such that you could go

logitf 0.5

and it could print 0, and leave behind

r(logit)

so that you could go

logitf <argument>
... = r(logit)

So you can't define a function allowing you then to do
things like

. di logitf(0.5)

in just one line.

Nick
[email protected]

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index