Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: possible bug in merge, keepusing


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: possible bug in merge, keepusing
Date   Sat, 5 Nov 2011 16:53:46 +0000

The argument to -keepusing()- is not parsed on receipt as a varlist
because it can't be, as it refers to variables not in memory. Quite
how it is handled is hidden inside the built-in command -_merge-, but
I think you are right in pointing out that -merge- does not expand
variable ranges. Oddly, wildcards such as M* don't cause a problem, in
my limited experiments.

Nicj

On Sat, Nov 5, 2011 at 1:56 PM, Robert Duval <rduval@gmail.com> wrote:
> Dear all.
>
> I apologize for calling out a bug, but i think there is something
> wrong with the merge command with the keepusing option. Consider the
> following code
>
> sysuse auto
> collapse price-headroom , by(foreign)
>
> foreach j of var price-head {
> rename `j' M`j'
> }
>
> save col
>
> sysuse auto
> merge m:1 foreign using col, keepusing(Mprice-Mrep78)
>
> the output I get from my Stata/MP 11.2 for Windows (64-bit x86-64) is
>
> variable Mprice-Mrep78 not found in using dataset
> r(111);
>
> namely it fails to recognize that Mprice-Mrep78 is a valid varlist.
> Instead if I enter the variables individually, i.e. Mprice Mmpg Mrep78
> everything goes as expected. In other words although the manual
> specifies that the keepusing() option accepts a varlist argument it
> doesn't recognize (at least in my case) the standar thisvar-thatvar
> varlist statement.
>
> Am I missing something here? Can you reproduce the mistake?
> Thanks in advance.
> robert
> *
> *   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/
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index