Statalist The Stata Listserver


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

RE: st: question from a new user


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: question from a new user
Date   Fri, 10 Feb 2006 16:51:14 -0000

I am an old user. This is a message of behalf 
of old users. Old users have needs too, 
particularly the need to be fed _answerable_ 
questions. 

I (we) (usually) have no idea what you mean by 
"doesn't work". Sometimes we can guess, but why should 
we have to guess? It's elementary -- but also 
fundamental -- we can't see your Results window
from where we are sitting!

Please, please spell out what happened -- and why 
you think it justifies "doesn't work". 

Nick 
[email protected] 

PS: I just did this. It worked for me. (No idea why you 
want to do this, but it's legal.) 

. sysuse auto, clear 
(1978 Automobile Data)

. regress mpg weight

      Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  1,    72) =  134.62
       Model |   1591.9902     1   1591.9902           Prob > F      =  0.0000
    Residual |  851.469256    72  11.8259619           R-squared     =  0.6515
-------------+------------------------------           Adj R-squared =  0.6467
       Total |  2443.45946    73  33.4720474           Root MSE      =  3.4389

------------------------------------------------------------------------------
         mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      weight |  -.0060087   .0005179   -11.60   0.000    -.0070411   -.0049763
       _cons |   39.44028   1.614003    24.44   0.000     36.22283    42.65774
------------------------------------------------------------------------------

. gen a = e(r2) + e(N)

. l a in 1

     +----------+
     |        a |
     |----------|
  1. | 74.65154 |
     +----------+

Rajesh Tharyan
 
> Is there a way to generate a new variable with those scalars  
> instead of
> just displaying it??
> 
> For example gen a=e(N) * e(r2) doesn't work..

*
*   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/



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