There is a multiple way of doing it, but see -help merge- if you are
building some sort of relational DB. (will work similar to linking
tables in Access).
If you have a single dataset, then -levelsof- gives you the distinct
values of a variable. You can test for each value of one variable if
it occurs in another. See -help levelsof- and -help macro-.
sysuse auto
levelsof make, local(m)
local v=`"`"Volvo 260"'"'
di `: list v in m'
local v=`"`"Volvo S70"'"'
di `: list v in m'
Regards, Sergiy
On 8/29/07, Dalhia <[email protected]> wrote:
> hi, I am trying to figure out a way to identify all
> observations in one variable that also appear in
> another variable. I have two variables - shareholder
> name and company name and I'm trying to find all the
> shareholders who are also on my list of companies. Is
> there a way to do this in Stata?
>
> Thanks so much for your help on this. I appreciate it.
>
> Dalhia Mani
>
>
>
> ____________________________________________________________________________________
> Got a little couch potato?
> Check out fun summer activities for kids.
> http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
> *
> * 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/