Statalist The Stata Listserver


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

RE: st: problems with e(sample)


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: problems with e(sample)
Date   Mon, 19 Jun 2006 08:09:29 +0100

Michael's -estsave- uses characteristics to 
store e(stuff). So this exception is no
exception to the comment about -save-, but
a work-around. 

e(sample) stays at least sometimes: 

. sysuse auto, clear 

. regress mpg weight if rep78 < . 

. count if e(sample) 
   69

. preserve 

. drop _all

. restore

. eret li

scalars:
                 e(N) =  69
              e(df_m) =  1
              e(df_r) =  67
                 e(F) =  123.808254590268
                e(r2) =  .6488621514626166
              e(rmse) =  3.502097049675242
               e(mss) =  1518.469087612675
               e(rss) =  821.7338109380502
              e(r2_a) =  .6436212880516109
                e(ll) =  -183.3739540339589
              e(ll_0) =  -219.4808398939586

macros:
             e(title) : "Linear regression"
            e(depvar) : "mpg"
               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)   

. count if e(sample) 
   69

Nick 
n.j.cox@durham.ac.uk 

Richard Williams
 
> Actually, with Michael Blasnik's -estsave- routine (available from 
> SSC) you can save estimation results with the current 
> dataset.  Although in the current example, I suppose a -restore- 
> would wipe those out.
> 
> As Zurab & Nick have already pointed out, you don't lose all the 
> eclass stuff, just e(sample).  As I stated before, my theory is that 
> e(sample) would be too hard to keep, because of all the machinations 
> that may have gone on with the data set in between the preserve and 
> the restore.
> 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index