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: comparing datasets


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: comparing datasets
Date   Mon, 8 Aug 2011 16:10:50 +0100

In practice, this recommendation is likely to bite because of the limits on length of string returned as the result of an evaluation. The equals sign forces an evaluation and will as a side-effect truncate strings to 244 characters.

One of several alternatives:

<read in first dataset>
unab first: *
<read in second dataset>
unab second: *

and then look at the difference between the two macros.

Nick

On 8 Aug 2011, at 15:45, Mauro Mastrogiacomo <[email protected]> wrote:

Hi, one way could be

des, varlist
local myvars=r(varlist)
dis "`myvars'"

if you repeat this also for the second dataset then you can subtract the two macro's and the difference is what you need.
mauro



-----Original Message-----
From: [email protected] [mailto:owner-
[email protected]] On Behalf Of Abhimanyu Arora
Sent: maandag 8 augustus 2011 16:32
To: [email protected]
Subject: Re: st: comparing datasets

As a follow up, there should be something in the macros in r(), but
return list gives me a blank stare.
Abhimanyu

On Mon, Aug 8, 2011 at 4:27 PM, Abhimanyu Arora
<[email protected]> wrote:
Dear statalist
Hope all's well
I have two datasets, one of which has all the variables of the
second,
plus additional variables. I would like to get a list of all these
additional variables. There's this obscure command -dta_equal- that I have got hold of, but contrary to what's in the help file, it doesn't
display the unique variables belonging to a particular dataset,
rather
seems to be working merely like the -cf-. Any
alternative/

*
*   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