Statalist


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

Re: st: identifying observations in one variable that appear in another variable


From   Dalhia <ggs_da@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: identifying observations in one variable that appear in another variable
Date   Thu, 30 Aug 2007 11:37:37 -0700 (PDT)

Hi, thanks for the response.  Just to make sure I
understand (I'm not very familiar with stata code) -
does this code basically check if particular values of
one variable exist in another variable?  Or does it
check all observations in one variable against another
variable? I have 9544 observations so the former
technique will be difficult.

thanks
dalhia
--- Sergiy Radyakin <serjradyakin@gmail.com> wrote:

> 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 <ggs_da@yahoo.com> 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/
> 



       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index