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]

Re: st: Calculating returns if a stock is delisted


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Calculating returns if a stock is delisted
Date   Thu, 4 Jul 2013 14:26:09 +0100

I think you need to make this much clearer; otherwise it will just get
ignored. Assume that even the kind of list member you want to answer
this knows nothing about  stocks or returns and sees here only messy
panel data. That will be a very accurate first approximation.

I read this about three times and still have only wild guesses at what
you want. It seems that it is not just a matter of the simultaneous
values of -DelistCode- and -DelistRet- but also of what information
there is elsewhere for the same -Id-.

I suggest that you try a complete statement of all the rules and also
give a very simple worked example of how the rules would apply.  All
you need to do is give a dataset big enough to show all the
complications that can arise. Use invented data for which the
manipulations are just mental arithmetic. You should probably not try
to guess at Stata code, but just spell out rules as a recipe in words.

Nick
[email protected]

On 4 July 2013 13:00, C. Evans <[email protected]> wrote:

> 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.
>
*
*   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