Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: identifying (not counting) observations repeated across observations


From   "Shahrul Mt-Isa" <[email protected]>
To   <[email protected]>
Subject   st: identifying (not counting) observations repeated across observations
Date   Tue, 25 Aug 2009 10:24:23 +0100

How many different entities are we talking about? If there are not many of
them and if I understood you correctly, you can easily use -strpos()-
function as below, otherwise you can still use the -strpos()- function in a
loop.

e.g. 
gen same_entities = 1 if strpos(name1,"AOL") | strpos(name2,"AOL").. etc
replace same_entities = 2 if ...

I suggest you change the names into all lower or all upper case to make it
easier to be picked up. You might want to delete all the space within names
as well e.g. "A O L" to "AOL". Look at -help strfun- 

BW,
Shahrul

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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