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" <>
To   <>
Subject   RE: st: problems with e(sample)
Date   Sun, 18 Jun 2006 15:41:03 +0100

This isn't quite the explanation. You can't save
eclass results with a dataset in any case, so 
whether they were or were not present previously
is secondary, indeed immaterial. 

The key fact remains that a -restore- loses the 
information currently in memory. This is not 
just the dataset currently in memory, but also
any eclass and rclass stuff in particular. (And
also ..., but let's focus on the main point.) 

In essence Zurab got what was asked for, however
much of a surprise that was. 

I guess the logic is that eclass and rclass stuff 
is not intrinsically part of the dataset. Also, 
in principle it can be re-produced at whim. 

The warning about -discard- is also puzzling here. 
The implication that it is a dangerous command 
is correct, but only if you don't read the help
and consider whether it is what you want. 


Ada Ma

> If you -preserve- before you do the regression, then your e(sample)
> won't be preserved as it wasn't there, so when you hit -restore- the
> ereturn values got zapped.
> You may want to watch out for -discard- too.  I had similar problems
> looking for the ereturn values, not knowing that I had wiped the slate
> clean as I try desperately to save some memory space for running more
> regressions.
Zurab Sajaia 

> > I found the cause of problem, -restore- works after setting 
> all the ereturns
> > and it clears e(sample) leaving other parameters unchanged.
> >
> > "esample(varname) specified with ereturn post or repost 
> gives the name of
> > the 0/1 variable indicating the observations involved in 
> the estimation.
> > The variable is removed from the data but is available for use as
> > e(sample);"
> >
> > This is what they say in the help so it's still unclear to 
> me why e(sample)
> > disapeares after restoring original data...

*   For searches and help try:

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