Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Timevarying IDs in a panel dataset


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Timevarying IDs in a panel dataset
Date   Tue, 22 Nov 2005 14:49:06 -0000

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



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index