Statalist


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

st: re: functions in Stata


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: re: functions in Stata
Date   Fri, 8 Aug 2008 13:38:23 -0400

< >
Sergiy said

Observation 1: some Stata commands return functions, e.g. -regress-
returns e(sample)

Observation 2: it is possible to get a list of defined functions by
reading extended macro function:

sysuse auto
regress p w
display `"`:e(functions)'"'

Observation 3: none of the official .ado files eshibits this feature

Observation 4: none of the user commands that I've seen uses this feature.

If there is any new information available now, that was not available
in 2003 I would be glad to hear that.

Why do I need to know this? I am writing a command that automatically
processes the results saved in r() e() s() and at the very least I
need to know whether any user-defined command could, can or will be
able to save anything in the "functions" section.



As far as I can see there is no provision for a user-written r-class ado file to return a function. An e-class ado-file can return e(sample) using ereturn post, but it does not appear that it can return any other function.


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


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