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

st: re: functions in Stata

From   Kit Baum <>
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
An Introduction to Modern Econometrics Using Stata:

* For searches and help try:

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