# Re: st: RE: Timevarying IDs in a panel dataset

 From Seb Buechte To statalist@hsphsun2.harvard.edu Subject Re: st: RE: Timevarying IDs in a panel dataset Date Tue, 22 Nov 2005 16:26:49 +0100

```Nick and Mark,

if the stock remains "physically" the same then the proposed solution
of Nick to generate a new and unique identifier for the stocks is help
with this problem. But, take a look at stock with id_now = 3 and
id_nextperiod = 2 and at the stock id_now = 2 and id_nextperiod = 2 it
looks to me as something that was different in "now" becomes the same
in "nextperiod". I feel like one might be running into some
statistical "issues" there.

Kind regards,
sebastian

On 11/22/05, Mark Schaffer <M.E.Schaffer@hw.ac.uk> wrote:
> Nick,
>
> > It is not clear that these identifiers are
> > really identifiers. Or, to put it another way,
> > how can this problem be solved at all?
> >
> > As I understand it, you may need a new identifier
> > based on a combination of now and the
> > next period. So, any stock that is 3 now
> > and 2 next period cannot be the same item
> > as one that is 3 and 3, any more than a person
> > who is male now and female next week can be the
> > same person as someone with more stable gender.
>
> But a person who has a maiden name last week and a married name this week
> is the same person.  This is what Daniel has, more or less.
>
> --M
>
> > But does a combination of now and next uniquely
> > identify stock?
> >
> > Nick
> > n.j.cox@durham.ac.uk
> >
> > Daniel Höchle
> >
> >> I do have a panel of several thousand stocks. Each stock has an id
> >> called ID_now. However, there is a problem: The stock's id may change
> >> over time. Therefore, I do have variable ID_nextperiod which contains
> >> the stock's id in the next period. The data looks like this:
> >>
> >> Date       ID_now       ID_nextperiod         Price_now
> >>  1           1               1                    100
> >>  2           1               1                    110
> >>  3           1               1                    105
> >>  4           1               1                    100
> >>  3           2               2                     22
> >>  4           2               2                     27
> >>  1           3               3                     20
> >>  2           3               2                     25
> >>  1           4               5                     60
> >>  2           5               5                     65
> >>  3           5               5                     67
> >> ...
> >>
> >> What I would like to do is calculating the discrete stock returns. If
> >> the stock's ID would not change over time this could be
> >> achieved (after
> >> tssetting the dataset) by simply typing
> >>
> >> . PriceRet = Price_now / L.Price_now - 1
> >>
> >> However, I do not have any idea how to calculate the discrete stock
> >> returns in case of changing IDs. Any ideas would be appreciated.
> >
> > *
> > *   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/
> >
>
>
> Prof. Mark Schaffer
> Director, CERT
> Department of Economics
> School of Management & Languages
> Heriot-Watt University, Edinburgh EH14 4AS
> tel +44-131-451-3494 / fax +44-131-451-3294
> email: m.e.schaffer@hw.ac.uk
> web: http://www.sml.hw.ac.uk/ecomes
>
>
>
> __________________________________________________________________
>
> DISCLAIMER:
>
> This e-mail message is subject to http://www.hw.ac.uk/disclaim.htm
> __________________________________________________________________
>
> *
> *   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/
>

--
- Seb F Buechte
-
- Stay tuned!

*
*   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/
```