[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: How do you drop the variable -(e)- from the data?
> I am having a problem with the variable whose name is (e), which
> be generated whenever an estimation command is executed, and which
> the results of the function -e(sample)-. This variable does not seem
> well publicised anywhere accessible via -findit (e)-, but is listed
> whenever the user types
> list *
> or when the user types
> list *e*
> or even when the user types
> list ?e?
> Similarly, if the user types
> unab fifi:*
> or if the user types
> unab fifi:*e*
> or even if the user types
> unab fifi:?e?
> then the expanded varlist in the macro -fifi- includes the varname
> My problem is, how do you drop (e) from the data set without
> other variables or estimation results? If I type
> ereturn clear
> then (e) ceases to exist, but so do the current estimation results.
If I type
> drop _all
> or if I type
> drop *e*
> or even if I type
> drop ?e?
> then Stata drops (e), and any other variables specified by the
> varlist provided by the user. However, if I type
> drop (e)
> then Stata replies
> variable e not found
> and refuses to drop (e). Is there a way of dropping (e) from the
> in a Stata program without destroying anything else?
I don't have a solution to this. In fact I've never even
noticed (e) before. This raises the question of whether
it's been there for ages, or it's only recently become
visible as a result of some other change in Stata.
I can add that attempts to solve Roger's problem indirectly by
-keep-ing everything else also failed.
To follow Roger's speculation, it appears that (e) is just
e(sample) in another guise. It looks like a variable in many
ways, but it isn't a full-fledged variable; let's call it a
pseudovariable in ignorance of any unpublicised Stata Corp
_n is another pseudovariable, one might say, although the
differences between it and (e) are just as crucial
as the differences. (For example, you can't drop _n
even indirectly; if you could, you would probably
break your Stata!)
What is a little more worrying is that there
seem to be small inconsistencies in how (e)
. su *
differ in whether (e) is included.
. d *
. ds *
do.... But then I have long assumed that
. su *
. d *
. ds *
. l *
were all equivalent pairs, and typed the simpler
version every time.
I see two contradictory and equally plausible
1 This is accidental, or even a mistake. Stata
Corp need to fix the code so that only their
outerwear is showing.
2 This is a subtle feature. Stata Corp have
introduced a nuanced distinction between
(every variable) and (every variable PLUS (e))
so that you can examine (e) whenever you wish,
so long as it exists.
P.S. at least one reason why you can't
look at (e) directly with e.g.
. l (e)
is that another rule, that varlists may
be parenthesised, leads to the parens being
* For searches and help try: