Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Strange behavior of cap drop XX


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Strange behavior of cap drop XX
Date   Mon, 30 Jan 2012 19:48:50 +0000

No error or bug as far as Stata is concerned, but intended behaviour.

If -EUp_2- is an unambiguous abbreviation of -EUp_20- then by default
it will be -drop-ped if you say -drop EUp_2-.

All the -capture- does is catch any error if no such variable exists.

Naturally it may be that you don't use abbreviations of variable names
and don't want to use them. In that case you need to

. set varabbrev off, permanently

Nick

.
On Mon, Jan 30, 2012 at 7:41 PM, B Villena <[email protected]> wrote:

>> I have a persistent error in my code involving cap drop
> In my data set there is a variable called EUp_20I want to be sure that the variable EUp_2 is not in the database so I write
> cap drop EUp_2
> Stata drops the variable EUp_20  !!!!!!!!I have tried this many times, but the same strange result happens again and again.
> What's going on? Is this a bug of Stata 11.2 MP2 or am I missing something here?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index