Statalist


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

Re: st: Compare values from two datasets


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

How about -joinby- the two data sets (given that values of both lic_no
and psycho_lic_no may be shared by more than one obs) and check the
values of _merge?


On Jan 16, 2008 1:51 PM, Gao Liu <[email protected]> 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/
>
*
*   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