-countmatch- on SSC is dedicated to this problem. It
counts matches, but as a useful side-product can list
them too.
countmatch var1 var2
Note that
countmatch var2 var1
is in general different. The help file includes many
comments on the problem, related problems, and details of various options.
Nick
[email protected]
Devendra Amre
Is there a STATA command similar to VLOOKUP that is available in EXCEL?
For example, I have a list of IDs as 2 variables. I wish to check if
any ID listed in var1 are present in var2..here is an example:
var1 var2
M101 F100
F100 M101
F120 F130
F145 M101
IDs M101 and F100 are common..is there some way of tagging these IDs?
*
* 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/