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

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: Functions in Stata |

Date |
Fri, 8 Aug 2008 18:30:26 +0100 |

This was the exchange Sergiy refers to. I don't think that users can produce beasts like e(sample). My guess is that StataCorp are using unpublicised hooks to do that. Nick --------------------------------------------------------------- 19 Dec 2003 --- Nick Cox See [U] 21.10 Saving results. Zurab Sajaia > I'm trying to find out how create some kind of function in > stata. After any > estimation command (regress for example) > eret list gives functions: e(sample). If I write > gen a=e(sample) > and if we specified IF and/or IN options in regress, a=1 > for those in > subsample and 0 otherwise. So, e(sample) is a function but > how can I return other functions from my program? ------------------------------------------------------------------------ -------- Sergiy Radyakin there was a question asked earlier on Fri, 19 Dec 2003 regarding defining functions in Stata, but essentially no answer was given (or none that I could find). Nick Cox pointed to the manual (I don't know which edition, but "saving results" is now 18.10 of [U]). This part of the manual does not describe the functions though. Here are some observations: 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. * * 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/

**Follow-Ups**:**Re: st: RE: Functions in Stata***From:*Richard Williams <Richard.A.Williams.5@ND.edu>

**References**:**st: Functions in Stata***From:*"Sergiy Radyakin" <serjradyakin@gmail.com>

- Prev by Date:
**st: panel unit root test t=4 / pooled estimation** - Next by Date:
**RE: st: RE: How to 'predict' residual by region? Seasonal adjustment?** - Previous by thread:
**st: Functions in Stata** - Next by thread:
**Re: st: RE: Functions in Stata** - Index(es):

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