Differences between revisions 1 and 2
Revision 1 as of 2022-09-25 20:07:05
Size: 1376
Comment:
Revision 2 as of 2022-09-25 20:07:24
Size: 1102
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Stata commands store intermediary and final values. These can be useful for programming, so they are exposed in a variety of way. into the r matrix, as a side effect. It is indexed by unique names; for example, many commands store the sample size as r(N). To view all available stored values, use return list. Stata commands store intermediary and final values. These can be useful for programming, so they are exposed in a variety of way.
Line 5: Line 5:
Macros are declared as either local or global, and are accessed by quoting with a prefixed grave and a postfixed apostrophe <<TableOfContents>>

----

Stata Stored Results

Stata commands store intermediary and final values. These can be useful for programming, so they are exposed in a variety of way.


R Class

The r() class stores results from general syntax commands. As an example:

count if EXPR
local total=r(N)

Try return list, all to see all stored results available in the r() class. Leaving off the all option hides some results.


E Class

The e() class stores results from estimations.

Try ereturn list, all to see all stored results available in the e() class. Leaving off the all option hides some results.


S Class

The s() class stores results from parsing commands.

Try sreturn list to see all stored results available in the s() class.


N Class

The n() class stores results that don't belong in any of the r(), e(), or s() classes.


C Class

Not actually a class for stored results: see System Parameters.


CategoryRicottone

Stata/StoredResults (last edited 2023-06-07 19:06:32 by DominicRicottone)