Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Compare values from two datasets


From   Richard Goldstein <[email protected]>
To   [email protected]
Subject   Re: st: Compare values from two datasets
Date   Wed, 16 Jan 2008 13:57:07 -0500

rename one of the variables so they have the same name in each file; sort each file by that variable and then use the -merge- command

Rich

Gao Liu wrote:

Hi, Statalist:

I have two datasets A and B. I need to create a dummy variable in A to
tell me whether the value of a string variable (say lic_no ) in A
matches any value in the variable of psycho_lic_no in B. Simply put, I
want to see whether the value for each obs. in A is on a list. But as
the list (the value of psycho_lic_no in B) is so long (over 10000), it
is inconvenient to copy and paste all the values, and compare them
with the lic_no one by one.

Any good way to make the job easier? Thank you.

Best

Gao
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index