RE: st: problems with e(sample)

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.

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.

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.)

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.

As a sidelight, beta versions of gologit2 used preserve and restore
(as does the original gologit), but I realized that e(sample) did not
work correctly when I did this. I finally figured out how to avoid
the preserve and restore. It is probably a little more efficient
from a programming standpoint if you can avoid preserve and
restore. You of course have to make sure your program isn't making
any unwanted changes to the data set.