Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: list coefficients


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: list coefficients
Date   Thu, 14 Apr 2011 07:51:34 +0100

Statistical commands are e-class or r-class but not both. Any r-class
results visible through -return li- after an e-class command are left
over from some previous r-class command, and vice versa.

-regress- is an e-class command. The coefficients are in e(b).

See the manual entry for -regress- for details; otherwise here is an example.

. sysuse auto
(1978 Automobile Data)

. gen gpm = 1/mpg

. reg gpm weight

      Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  1,    72) =  194.71
       Model |  .008729651     1  .008729651           Prob > F      =  0.0000
    Residual |  .003227977    72  .000044833           R-squared     =  0.7300
-------------+------------------------------           Adj R-squared =  0.7263
       Total |  .011957628    73  .000163803           Root MSE      =   .0067

------------------------------------------------------------------------------
         gpm |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      weight |   .0000141   1.01e-06    13.95   0.000     .0000121    .0000161
       _cons |   .0077077   .0031426     2.45   0.017     .0014431    .0139723
------------------------------------------------------------------------------

. eret li

scalars:
                  e(N) =  74
               e(df_m) =  1
               e(df_r) =  72
                  e(F) =  194.7147936876549
                 e(r2) =  .7300487198159771
               e(rmse) =  .0066957458953447
                e(mss) =  .0087296508951938
                e(rss) =  .0032279769428418
               e(r2_a) =  .7262993964800879
                 e(ll) =  266.4772448354964
               e(ll_0) =  218.0252349744391

macros:
            e(cmdline) : "regress gpm weight"
              e(title) : "Linear regression"
                e(vce) : "ols"
             e(depvar) : "gpm"
                e(cmd) : "regress"
         e(properties) : "b V"
            e(predict) : "regres_p"
              e(model) : "ols"
          e(estat_cmd) : "regress_estat"

matrices:
                  e(b) :  1 x 2
                  e(V) :  2 x 2

functions:
             e(sample)

. mat li e(b)

e(b)[1,2]
       weight      _cons
y1  .00001407  .00770767

. mat b = e(b)


On Thu, Apr 14, 2011 at 7:43 AM, Max Fotbollen <praktiskbox@live.se> wrote:

> I need to get full digit, including all decimals points, coeffcient estimates from a regression. I use ereturn and get numbers for some of estimates but not the coefficients. The command "return list" does not render any output.
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index