[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: problems with e(sample)
At 05:33 PM 6/16/2006, Zurab Sajaia wrote:
I found the cause of problem, -restore- works after setting all the
ereturns and it clears e(sample) leaving other parameters unchanged.
I am not sure how e(sample) works but I have always suspected it is
really a variable masquerading as a function. If not, it must
contain all the rules that would be needed to create such a
variable. In any event, it seems to behave pretty much the same way
as a variable - restore the data to an earlier point and variables
created since then (along with e(sample)) get lost too.
"esample(varname) specified with ereturn post or repost gives the
name of the 0/1 variable indicating the observations involved in the
The variable is removed from the data but is available for use as
This is what they say in the help so it's still unclear to me why
e(sample) disapeares after restoring original data...
I can see why it would be difficult to keep e(sample) alive after
doing a restore. Suppose I preserved the data, then did a collapse,
then did a restore. What is e(sample) supposed to identify as 0 and
1? Or, suppose I preserved, gave various commands that deleted or
added cases, ran my command, and then restored. How would e(sample)
keep track of all the data commands that occurred before I ran my
estimation command? Or, how about preserve, reshape, restore?
I suppose if you really wanted/needed to keep e(sample) alive, you
could create and save a new dataset before you did you restore, and
then merge your original data set with the one that contained
e(sample). Alternatively, I suppose it wouldn't be too hard to
figure out the commands that would generate e(sample) if you didn't
already have it.
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
* For searches and help try: