Bookmark and Share

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]

st: Calculating returns if a stock is delisted


From   "C. Evans" <[email protected]>
To   [email protected]
Subject   st: Calculating returns if a stock is delisted
Date   04 Jul 2013 13:00:03 +0100

Dear Statalist

My dataset goes from 1964 to 31 December 1997. I am looking at stock returns and trying to create a new variable that will be related to returns. This new variable will use DelistRet (delisted return) if avilable and then use the delist code to determine what to multiply it by. As such, a delist code of between 500 and 600 would be multiplied by -0.3. However, sometimes the stock finishes at q date before 31 December 1997 and has no delistcode or delistret, for this I need to multiply the Return by -1. For all the other days when the stock is trading and not delisted I would just use Return.

Below is an example of my data (not going all the way to 31Dec1997)
Id  Date   DelistCode DelistRet Return Day Month   Year
1 2Jan1964 . . 1.1 2 1 1964 1 3Jan1964 520 -0.7 1.2 3 1 1964
2  2Jan1964    .        .        1.2    2    1     1964
2  3Jan1964    .        .        1.4    3    1     1964
2  4Jan1964    .        .        1.3    4    1     1964

I was trying to do this in stages as my stata skills are not great. I had an idea to use:

egen delisted = 1 if max(date)  != day==31 & month==12 & year ==1997

Which I thought would give a value of 1 for the stocks that didn't reach the max date. I'd be much happier to use a different line of code and I am open to any suggestions.

Best Regards,
Chris Evans
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index