This works if and only if the command is r class. 
(That is the definition of r class.) Regression-like 
commands are e class, and the corresponding command is
. ereturn li 
or 
. eret li 
Nick 
[email protected] 
[email protected]
 
> with the command return list you can see how call the results
> example
>  sum rgdpl
> 
>     Variable |       Obs        Mean    Std. Dev.       Min        Max
> -------------+--------------------------------------------------------
>        rgdpl |       152    4626.693    2138.292    1692.86   11167.49
> 
>  return list
> 
> scalars:
>                  r(N) =  152
>              r(sum_w) =  152
>               r(mean) =  4626.692887155633
>                r(Var) =  4572291.459771345
>                 r(sd) =  2138.291715311862
>                r(min) =  1692.859985351563
>                r(max) =  11167.490234375
>                r(sum) =  703257.3188476563
> 
> 
> > I am a relatively new user of Stata having used SAS for 
> many years. I
> > know that when you run a regression in Stata it produces a 
> whole series
> > of results that are stored under e( ) e.g. R squared, N, 
> RSS etc. The
> > problem I am having is I can't figure out how to access those stored
> > results. I want to use the stored results to calculate an 
> LM statistic.
> > I can do this manually using the results and the display command but
> > there must be a way of programing Stata to do this task.
> >
> > Here is what I want to do. I run a restricted regression 
> and then obtain
> >  the residuals. Next I regress the residuals on the independent
> > variables  from the unrestricted model. N times the R 
> square from this
> > equation is  an LM statistic.
*
*   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/