Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: RE: Spotting changes in identifier
From
"Pavlos C. Symeou" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: RE: Spotting changes in identifier
Date
Wed, 07 Jul 2010 14:05:50 +0200
thanks for the reply. As you suggest I omit the "" but what the new
command returns is the last year-observation for all companies in
my dataset.
Is there a possible explanation for that?
Best,
Pavlos
On 07/07/2010 13:12, Nick Cox wrote:
You tried
bysort name: l name ticker year if ticker[_n]!="ticker[_n+1]"
but you need to omit the " ". What you typed is legal, but the literal text
"ticker[_n+1]"
presumably never is an actual value of -ticker-, so this will list all the data, as every value of ticker is indeed not equal to that text.
As said, omit the "".
Nick
[email protected]
Pavlos C. Symeou
I have panel data on a number of companies over a series of years.
Two of my variables uniquely identify an observation (Name and
Ticker). For different reasons:
a) the Name may have changed over the years whilst the Ticker may
have remained the same;
year name ticker
1999 stata ss
2000 strata ss
b) the Ticker may have changed over the years whilst Name may have
remained the same;
year name ticker
1999 stata ss
2000 stata sss
c) both may have changed
year name ticker
1999 stata ss
2000 strata sss
I am interested in identifying cases a) and b) above (considering
that case c might require visual observation rather than an
automated process)
Do you have any suggestions?
I have tried
bysort name: l name ticker year if ticker[_n]!="ticker[_n+1]"
but it doesn't seem to work. Both Name and Ticker are string variables.
*
* 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/
*
* 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/